diff --git a/.gitignore b/.gitignore index 940794e60f..565e7ae9fb 100644 --- a/.gitignore +++ b/.gitignore @@ -286,3 +286,7 @@ __pycache__/ *.btm.cs *.odx.cs *.xsd.cs + +package-lock.json +*.class +test/*/target/ \ No newline at end of file diff --git a/.gulp/common.iced b/.gulp/common.iced new file mode 100644 index 0000000000..a5265ce837 --- /dev/null +++ b/.gulp/common.iced @@ -0,0 +1,489 @@ +through = require 'through2' +util = require 'util' + + +# place an object into global namespace +global['Import'] = (object) -> + for key, value of object + global[key] = value + +Import + # require into the global namespace (modulename = module) + Install: (modulename, module) -> + global[modulename] = require module or modulename + + # require a gulp-Plugin into the global namespace + Plugin: () -> + Install module,"gulp-#{module}" for module in arguments + + # require a module, placing exports into global namespace + Include: () -> + Import require module for module in arguments + + Tasks: () -> + require "#{__dirname}/#{module}" for module in arguments + +############################################### +# force-global a bunch of stuff. +require 'shelljs/global' +Install 'marked' +Install 'vinyl' +Install 'os' +Install 'path' +Install 'fs' +Install 'gulp' +Install 'util' +Install 'moment' +Install 'chalk' +Install 'yargs' +Install 'semver' + +Install 'eol', 'gulp-line-ending-corrector' +Install 'through', 'through2-parallel' +Install 'run', 'run-sequence' + +# do a bit of monkeypatching +_gulpStart = gulp.Gulp::start +_runTask = gulp.Gulp::_runTask + +gulp.Gulp::start = (taskName) -> + @currentStartTaskName = taskName + _gulpStart.apply this, arguments + return + +gulp.Gulp::_runTask = (task) -> + @currentRunTaskName = task.name + _runTask.apply this, arguments + return + +# echo 'this.currentStartTaskName: ' + this.currentStartTaskName +# echo 'this.currentRunTaskName: ' + this.currentRunTaskName + +# bring some gulp-Plugins along +# Plugin 'filter', +# 'zip' + #'unzip' + #'rename' + +# force this into global namespace +global['argv'] = yargs.argv + +fs = require('fs') +path = require('path') + +concurrency = 0 +queue = [] +global.completed = [] +vfs = require('vinyl-fs'); + +module.exports = + # lets us just handle each item in a stream easily. + foreach: (delegate) -> + through.obj { concurrency: threshold }, ( each, enc, done ) -> + delegate each, done, this + + count: (result,passthru) => + foreach (each,done) => + result++ + done null + + hashCode: (s) -> + (s.split('').reduce ((a, b) -> + a = (a << 5) - a + b.charCodeAt(0) + a & a + ), 0 ) .toString(16) + + toArray: (result,passthru) => + foreach (each,done) => + result.push(each) + if passthru + done null, each + else + done null + + showFiles: () -> + foreach (each,done) -> + echo info each.path + done null, each + + onlyFiles: () -> + foreach (each,done) -> + return done null, each if fs.statSync(each.path).isFile() + done null + + source: (globs, options ) -> + options = options or { } + options.follow = true + vfs.src( globs, options) + + watchFiles: (src,tasks) -> + return gulp.watch( src,tasks) + + destination: (globs, options ) -> + gulp.dest( globs, options) + + later: (fn) -> + setTimeout fn, 10 + + mklink: (link,target) -> + # unlink link + if ! test "-d", link + fs.symlinkSync target, link, "junction" + + unlink: (link) -> + if test "-d", link + fs.unlinkSync link + + erase: (file) -> + if test "-f", file + fs.unlinkSync file + + task: (name, description, deps, fn) -> + throw "Invalid task name " if typeof name isnt 'string' + throw "Invalid task description #{name} " if typeof description isnt 'string' + + if typeof deps == 'function' + fn = deps + deps = [] + + # chain the task if it's a repeat + if name of gulp.tasks + prev = gulp.tasks[name] + + # reset the name of this task to be a 'child'' task + name = "#{name}/#{description}" + description = '' + + # add this task as a dependency of the original task. + prev.dep.unshift name + + # add the new task. + # gulp.task name, deps, fn + skip = (name.startsWith "init") or (name.startsWith "npm-install") or (name.startsWith "clean") or (name is "copy-dts-files") or (name.startsWith "nuke") or (name.startsWith "reset") or (name.startsWith "autorest") or description.endsWith("!") + + description = '' if description = '!' + + if !skip + deps.unshift "init" + + if fn.length # see if the task function has arguments (betcha never saw that before!) + gulp.task name, deps, (done)-> + if not global.completed[name] + #echo warning "Running task #{name} #{typeof done}" + global.completed[name] = true + return fn(done) + #echo warning "Skipping completed task #{name}" + return done() + else + gulp.task name, deps, ()-> + if not global.completed[name] + #echo warning "Running task #{name}" + global.completed[name] = true + return fn() + #echo warning "Skipping completed task #{name}" + return null + + + # set the description + gulp.tasks[name].description = description + + return + + where: (predicate) -> + foreach (each,done) -> + #return done null if each? + return done null, each if predicate each + done null + + splitPath: (path) -> + s = path.match /^(.+)[\\\/]([^\/]+)$/ or [path, '',path] + f = s[2].match(/^(.*)([\\.].*)$/ ) or [s[2],s[2],''] + d = (path.match /^(.:)[\\\/]?(.*)$/ ) or ['','',path] + return { + fullname : path + folder : s[1] + filename : s[2] + basename : f[1] + extension : f[2] + drive: d[1] or '' + folders: (d[2].split /[\\\/]/ )or path + } + + folder: (path) -> + return '' if not path + return (splitPath path).folder + + split: (path) -> + return '' if not path + return (splitPath path).folders + + filename: (path) -> + return '' if not path + p = splitPath path + return p.filename + + extension: (path) -> + return '' if not path + p = splitPath path + return p.extension + + basename: (path) -> + return '' if not path + p = splitPath path + return p.basename + + exists: (path) -> + return test '-f', path + + fileExists: (path) -> + return test '-f', path + + dirExists: (path) -> + return test '-d', path + + newer: (first,second) -> + return true if (!test "-d", second) and (!test "-f", second) + return false if (!test "-d",first) and (!test "-f", first) + f = fs.statSync(first).mtime + s = fs.statSync(second).mtime + return f > s + + flattenEncode: (path) -> + path.basename = "#{ path.dirname.replace(/[\/\\]/g, '_') }_#{path.basename}" + path.dirname = "" + + flattenDecode: (path) -> + f = path.basename.match(/^(.*)_(.*)$/ ) + path.basename = "#{f[1].replace(/[_]/g, '/') }/#{f[2]}" + path.dirname = "" + + except: (match) -> + # await through.obj defer file, enc, callback + through.obj (file, enc, callback) -> + + # check if the file is an actual file. + # if it's not, just skip this tool. + if !file or !file.path + return callback null, file + + # do something with the file + if file.path.match( match ) + return callback null + + return callback null, file + + + rmfile: (dir, file, callback) -> + p = path.join(dir, file) + fs.lstat p, (err, stat) -> + if err + callback.call null, err + else if stat.isDirectory() + rmdir p, callback + else + fs.unlink p, callback + return + return + + rmdir: (dir, callback) -> + #echo "RMDIR #{dir}" + fs.readdir dir, (err, files) -> + if err + callback.call null, err + else if files.length + i = undefined + j = undefined + i = j = files.length + while i-- + rmfile dir, files[i], (err) -> + if err + callback.call null, err + else if --j == 0 + fs.rmdir dir, callback + return + else + fs.rmdir dir, callback + return + return + + guid: -> + x = -> Math.floor((1 + Math.random()) * 0x10000).toString(16).substring 1 + "#{x()}#{x()}-#{x()}-#{x()}-#{x()}-#{x()}#{x()}#{x()}" + + Fail: (text) -> + echo "" + echo "#{ error 'Task Failed:' } #{error_message text}" + echo "" + rm '-rf', workdir + process.exit(1) + + execute: (cmdline,options,callback, ondata)-> + if typeof options == 'function' + ondata = callback + callback = options + options = { } + + # if we're busy, schedule again... + if concurrency >= threshold + queue.push(-> + execute cmdline, options, callback, ondata + ) + return + + concurrency++ + + options.cwd = options.cwd or basefolder + echo " #{quiet_info options.cwd} :: #{info cmdline}" if !options.silent + + options.silent = !verbose + + proc = exec cmdline, options, (code,stdout,stderr)-> + concurrency-- + + if code and (options.retry or 0) > 0 + echo warning "retrying #{options.retry} #{options.cwd}/#{cmdline}" + options.retry-- + return execute cmdline,options,callback,ondata + + + # run the next one in the queue + if queue.length + fn = (queue.shift()) + fn() + + if code and !options.ignoreexitcode + echo error "Exec Failed #{quiet_info options.cwd} :: #{info cmdline}" + if( stderr.length ) + echo error "(stderr)" + echo marked ">> #{error stderr}" + if( stdout.length ) + echo warning "(stdout)" + echo warning stdout + + Fail "Execute Task failed, fast exit" + callback(code,stdout,stderr) + + proc.stdout.on 'data', ondata if ondata + return proc + + autorest: (args,done,ignoreexitcode) -> + echo info "Queuing up: AutoRest #{args.join(' ')}" + execute "autorest \"--use=#{basefolder}\" #{args.map((a) -> "\"#{a}\"").join(' ')}" , {silent:true, ignoreexitcode: ignoreexitcode || false}, (code,stdout,stderr) -> + return done(code,stdout,stderr) + +# build task for global build +module.exports.task 'build', 'builds project', -> + echo "Building project in #{basefolder}" + +module.exports.task 'clean', 'cleans the project files', -> + +module.exports.task 'regenerate', 'regenerates expected files for testing', -> + + +# task for vs code +module.exports.task 'code', 'launches vs code', -> + exec "code #{basefolder}" + +module.exports.task 'release-only', '', (done)-> + Fail( "This command requires --configuration release" ) if configuration isnt "Release" + done() + +configString = (s)-> + "#{s.charAt 0 .toUpperCase()}#{s.slice 1 .toLowerCase() }" + +# bring current module into global namespace. +Import module.exports + +############################################### +# Global values +process.env["autorest.home"] = path.normalize("#{os.tmpdir()}/autorest#{hashCode(basefolder)}") +process.env.tmp = process.env.tmp or "#{basefolder}/tmp" + +package_json = require("#{basefolder}/package.json") + + +Import + stable: argv.stable or false + configuration: if argv.configuration then configString( argv.configuration) else (if argv.release then 'Release' else 'Debug') + github_apikey: argv.github_apikey or process.env.GITHUB_APIKEY or null + nuget_apikey: argv.nuget_apikey or process.env.NUGET_APIKEY or null + npm_apikey: argv.npm_apikey or process.env.NPM_APIKEY or null + autorest_home: process.env["autorest.home"] + today: moment().format('YYYYMMDD') + now: moment().format('YYYYMMDD-HHmm') + force: argv.force or false + threshold: argv.threshold or ((os.cpus().length)-1) or 1 + verbose: argv.verbose or null + workdir: "#{process.env.tmp}/gulp/#{module.exports.guid()}" + watch: argv.watch or false + +mkdir "-p", workdir if !test "-d", workdir + +############################################### +# UI stuff +TerminalRenderer = require('marked-terminal') +marked.setOptions { + renderer: new TerminalRenderer({ + heading: chalk.green.bold, + firstHeading: chalk.green.bold, + showSectionPrefix: false, + strong: chalk.bold.cyan, + em: chalk.cyan, + blockquote: chalk.magenta, + tab: 2 + }) +} + +set '+e' + +Import + error: chalk.bold.red + error_message: chalk.bold.cyan + warning: chalk.bold.yellow + info: chalk.bold.green + quiet_info: chalk.green + +############################################### +task 'default','', -> + cmds = "" + + for name, t of gulp.tasks + cmds += "\n gulp **#{name}** - #{t.description}" if t.description? and t.description.length + switches = "" + + echo marked """ + +# Usage + +## gulp commands +#{cmds} + +## available switches + *--force* specify when you want to force an action (restore, etc) + *--configuration* 'debug' or 'release' + *--release* same as --configuration=release + *--nightly* generate label for package as 'YYYYMMDD-0000-nightly' + *--preview* generate label for package as 'YYYYMMDD-HHmm-preview' + *--verbose* enable verbose output + *--threshold=nn* set parallelism threshold (default = 10) + +#{switches} +""" + +task 'test', "Run Tests", -> + +task 'fix-line-endings', 'Fixes line endings to file-type appropriate values.', -> + source "**/*.iced" + .pipe eol {eolc: 'LF', encoding:'utf8'} + .pipe destination '.' + +task 'version-number', '!', (done)-> + if argv.version + global.version = argv.version if argv.version + done(); + else + # git rev-list --parents HEAD --count --full-history + execute "git rev-list --parents HEAD --count --full-history" , {silent:true}, (c,o,e)-> + pv = (package_json.version).trim() + global.version = "#{semver.major(pv)}.#{semver.minor(pv)}.#{o.trim()}" + done(); diff --git a/.gulp/dotnet.iced b/.gulp/dotnet.iced new file mode 100644 index 0000000000..6ddea8e5c5 --- /dev/null +++ b/.gulp/dotnet.iced @@ -0,0 +1,59 @@ + +# ============================================================================== +# file selections + +Import + projects:() -> + source '**/*.csproj' + .pipe except /preview/ig + +# ============================================================================== +# Functions + +dotnet = (cmd) -> + foreach (file, callback) -> + # check if the file is an actual file. + # if it's not, just skip this tool. + if !file or !file.path + return callback null, file + + # do something with the file + await execute "dotnet #{cmd} #{ file.path } /nologo", defer code,stdout,stderr + # Fail "dotnet #{cmd} failed" if code + # or just done, no more processing + return callback null + +# ============================================================================== +# Tasks + + +task 'build','dotnet',['restore'], (done) -> + execute "dotnet build -c #{configuration} #{solution} /nologo /clp:NoSummary", (code, stdout, stderr) -> + execute "dotnet publish -c #{configuration} #{sourceFolder} --output #{sourceFolder}/bin/netcoreapp2.0 /nologo /clp:NoSummary ", (code, stdout, stderr) -> + done() + +task 'clear-cache-on-force', '', (done)-> + if global.force + execute "dotnet nuget locals http-cache --clear", (c,o,e) -> + done() + else + done() + +task 'restore','restores the dotnet packages for the projects',['clear-cache-on-force'], (done) -> + + if ! test '-d', "#{os.homedir()}/.nuget" + global.force = true + + projects() + .pipe where (each) -> # check for project.assets.json files are up to date + rm "#{folder each.path}/obj/project.assets.json" if (force and test '-f', "#{folder each.path}/obj/project.assets.json") + return true if force + assets = "#{folder each.path}/obj/project.assets.json" + return false if (exists assets) and (newer assets, each.path) + return true + .pipe foreach (each,done)-> + execute "dotnet restore #{ each.path } /nologo", {retry:1},(code,stderr,stdout) -> + done() + +# the dotnet gulp-plugin. +module.exports = dotnet \ No newline at end of file diff --git a/.gulp/gulpfile.iced b/.gulp/gulpfile.iced new file mode 100644 index 0000000000..ea9bd8c18c --- /dev/null +++ b/.gulp/gulpfile.iced @@ -0,0 +1,27 @@ +require './common.iced' + +# ============================================================================== +# tasks required for this build +Tasks "dotnet" # dotnet functions +Tasks "regeneration" + +# ============================================================================== +# Settings +Import + initialized: false + solution: "#{basefolder}/autorest.java.sln" + sourceFolder: "#{basefolder}/src/" + +# ============================================================================== +# Tasks + +task 'init', "" ,(done)-> + Fail "YOU MUST HAVE NODEJS VERSION GREATER THAN 7.10.0" if semver.lt( process.versions.node , "7.10.0" ) + done() + +# Run language-specific tests: +task 'test', "", [], (done) -> + await execute "mvn test -pl test/vanilla", defer code, stderr, stdout + await execute "mvn test -pl test/azure", defer code, stderr, stdout + await execute "mvn test -pl test/azurefluent", defer code, stderr, stdout + done(); diff --git a/.gulp/regeneration.iced b/.gulp/regeneration.iced new file mode 100644 index 0000000000..74b8a5a887 --- /dev/null +++ b/.gulp/regeneration.iced @@ -0,0 +1,146 @@ + +############################################### +# LEGACY +# Instead: have bunch of configuration files sitting in a well-known spot, discover them, feed them to AutoRest, done. + +regenExpected = (opts,done) -> + outputDir = if !!opts.outputBaseDir then "#{opts.outputBaseDir}/#{opts.outputDir}" else opts.outputDir + keys = Object.getOwnPropertyNames(opts.mappings) + instances = keys.length + + for kkey in keys + optsMappingsValue = opts.mappings[kkey] + key = kkey.trim(); + + swaggerFiles = (if optsMappingsValue instanceof Array then optsMappingsValue[0] else optsMappingsValue).split(";") + args = [ + "--#{opts.language}", + "--output-folder=#{outputDir}/#{key}", + "--license-header=#{if !!opts.header then opts.header else 'MICROSOFT_MIT_NO_VERSION'}", + "--enable-xml" + ] + + for swaggerFile in swaggerFiles + args.push("--input-file=#{if !!opts.inputBaseDir then "#{opts.inputBaseDir}/#{swaggerFile}" else swaggerFile}") + + if (opts.addCredentials) + args.push("--#{opts.language}.add-credentials=true") + + if (opts.azureArm) + args.push("--#{opts.language}.azure-arm=true") + + if (opts.fluent) + args.push("--#{opts.language}.fluent=true") + + if (opts.syncMethods) + args.push("--#{opts.language}.sync-methods=#{opts.syncMethods}") + + if (opts.flatteningThreshold) + args.push("--#{opts.language}.payload-flattening-threshold=#{opts.flatteningThreshold}") + + if (!!opts.nsPrefix) + if (optsMappingsValue instanceof Array && optsMappingsValue[1] != undefined) + args.push("--#{opts.language}.namespace=#{optsMappingsValue[1]}") + else + args.push("--#{opts.language}.namespace=#{[opts.nsPrefix, key.replace(/\/|\./, '')].join('.')}") + + if (opts['override-info.version']) + args.push("--override-info.version=#{opts['override-info.version']}") + if (opts['override-info.title']) + args.push("--override-info.title=#{opts['override-info.title']}") + if (opts['override-info.description']) + args.push("--override-info.description=#{opts['override-info.description']}") + + autorest args,() => + instances-- + return done() if instances is 0 + +defaultMappings = { + 'AcceptanceTests/ParameterFlattening': 'parameter-flattening.json', + 'AcceptanceTests/BodyArray': 'body-array.json', + 'AcceptanceTests/BodyBoolean': 'body-boolean.json', + 'AcceptanceTests/BodyByte': 'body-byte.json', + 'AcceptanceTests/BodyComplex': 'body-complex.json', + 'AcceptanceTests/BodyDate': 'body-date.json', + 'AcceptanceTests/BodyDateTime': 'body-datetime.json', + 'AcceptanceTests/BodyDateTimeRfc1123': 'body-datetime-rfc1123.json', + 'AcceptanceTests/BodyDuration': 'body-duration.json', + 'AcceptanceTests/BodyDictionary': 'body-dictionary.json', + 'AcceptanceTests/BodyFile': 'body-file.json', + 'AcceptanceTests/BodyFormData': 'body-formdata.json', + 'AcceptanceTests/BodyInteger': 'body-integer.json', + 'AcceptanceTests/BodyNumber': 'body-number.json', + 'AcceptanceTests/BodyString': 'body-string.json', + 'AcceptanceTests/Header': 'header.json', + 'AcceptanceTests/Http': 'httpInfrastructure.json', + 'AcceptanceTests/Report': 'report.json', + 'AcceptanceTests/RequiredOptional': 'required-optional.json', + 'AcceptanceTests/Url': 'url.json', + 'AcceptanceTests/Validation': 'validation.json', + 'AcceptanceTests/CustomBaseUri': 'custom-baseUrl.json', + 'AcceptanceTests/CustomBaseUriMoreOptions': 'custom-baseUrl-more-options.json', + 'AcceptanceTests/ModelFlattening': 'model-flattening.json' +} + +defaultAzureMappings = { + 'AcceptanceTests/Lro': 'lro.json', + 'AcceptanceTests/Paging': 'paging.json', + 'AcceptanceTests/AzureReport': 'azure-report.json', + 'AcceptanceTests/AzureParameterGrouping': 'azure-parameter-grouping.json', + 'AcceptanceTests/AzureResource': 'azure-resource.json', + 'AcceptanceTests/Head': 'head.json', + 'AcceptanceTests/HeadExceptions': 'head-exceptions.json', + 'AcceptanceTests/SubscriptionIdApiVersion': 'subscriptionId-apiVersion.json', + 'AcceptanceTests/AzureSpecials': 'azure-special-properties.json', + 'AcceptanceTests/CustomBaseUri': 'custom-baseUrl.json' +} + +swaggerDir = "node_modules/@microsoft.azure/autorest.testserver/swagger" + +task 'regenerate-javaazure', '', (done) -> + mappings = {} + for key of defaultAzureMappings + mappings[key.substring(16).toLowerCase()] = defaultAzureMappings[key] + regenExpected { + 'outputBaseDir': 'test/azure', + 'inputBaseDir': swaggerDir, + 'mappings': mappings, + 'outputDir': 'src/main/java/fixtures', + 'language': 'java', + 'azureArm': true, + 'nsPrefix': 'Fixtures' + },done + return null + +task 'regenerate-javaazurefluent', '', (done) -> + mappings = {} + for key of defaultAzureMappings + mappings[key.substring(16).toLowerCase()] = defaultAzureMappings[key] + regenExpected { + 'outputBaseDir': 'test/azurefluent', + 'inputBaseDir': swaggerDir, + 'mappings': mappings, + 'outputDir': 'src/main/java/fixtures', + 'language': 'java', + 'azureArm': true, + 'fluent': true, + 'nsPrefix': 'Fixtures' + },done + return null + +task 'regenerate-java', '', (done) -> + mappings = {} + for key of defaultMappings + mappings[key.substring(16).toLowerCase()] = defaultMappings[key] + regenExpected { + 'outputBaseDir': 'test/vanilla', + 'inputBaseDir': swaggerDir, + 'mappings': mappings, + 'outputDir': 'src/main/java/fixtures', + 'language': 'java', + 'nsPrefix': 'Fixtures' + },done + return null + +task 'regenerate', "regenerate expected code for tests", ['regenerate-java', 'regenerate-javaazure', 'regenerate-javaazurefluent'], (done) -> + done(); diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000000..f8a119caaf --- /dev/null +++ b/.npmignore @@ -0,0 +1,7 @@ +.gulp/ +.vscode/ +test/ +gulpfile.js +*.sln + +src/obj/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..87ac583fe2 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to find out which attributes exist for C# debugging + // Use hover for the description of the existing attributes + // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..591527e5c7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,22 @@ +{ + // we use gulp. npm is just for show. + "npm.autoDetect": "off", + "[csharp]": { + "editor.tabSize": 4 + }, + "[typescript]": { + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.tabSize": 2, + "editor.detectIndentation": false + }, + "[json]": { + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.tabSize": 2, + "editor.detectIndentation": false + }, + "files.associations": { + "*.iced": "coffeescript" + } +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000000..41eb96d599 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,29 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "type": "gulp", + "task": "test", + "problemMatcher": [ + "$msCompile" + ], + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "type": "gulp", + "task": "build", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$msCompile" + ] + } + ] + } \ No newline at end of file diff --git a/README.md b/README.md index 72f1506a93..f5acf8f469 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,43 @@ provided by the bot. You will only need to do this once across all repos using o This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +# AutoRest extension configuration + +``` yaml +use-extension: + "@microsoft.azure/autorest.modeler": "*" + +pipeline: + java/modeler: + input: swagger-document/identity + output-artifact: code-model-v1 + scope: java + java/commonmarker: + input: modeler + output-artifact: code-model-v1 + java/cm/transform: + input: commonmarker + output-artifact: code-model-v1 + java/cm/emitter: + input: transform + scope: scope-cm/emitter + java/generate: + plugin: java + input: cm/transform + output-artifact: source-file-java + java/transform: + input: generate + output-artifact: source-file-java + scope: scope-transform-string + java/emitter: + input: transform + scope: scope-java/emitter + +scope-java/emitter: + input-artifact: source-file-java + output-uri-expr: $key + +output-artifact: +- source-file-java +``` \ No newline at end of file diff --git a/autorest.java.sln b/autorest.java.sln new file mode 100644 index 0000000000..d6a015c761 --- /dev/null +++ b/autorest.java.sln @@ -0,0 +1,33 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26430.16 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "autorest.java", "src\autorest.java.csproj", "{9E857E16-C008-4311-8799-CFA9D292D0B6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Debug|x64.ActiveCfg = Debug|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Debug|x64.Build.0 = Debug|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Debug|x86.ActiveCfg = Debug|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Debug|x86.Build.0 = Debug|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Release|Any CPU.Build.0 = Release|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Release|x64.ActiveCfg = Release|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Release|x64.Build.0 = Release|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Release|x86.ActiveCfg = Release|Any CPU + {9E857E16-C008-4311-8799-CFA9D292D0B6}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000000..f231d0173d --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,4 @@ +// set the base folder of this project +global.basefolder = `${__dirname}` +require ("rechoir").prepare(require('interpret').extensions, './.gulp/gulpfile.iced'); +require ('./.gulp/gulpfile.iced') diff --git a/package.json b/package.json new file mode 100644 index 0000000000..4e805f5b9a --- /dev/null +++ b/package.json @@ -0,0 +1,48 @@ +{ + "name": "@microsoft.azure/autorest.java", + "version": "1.9.0", + "description": "The Java extension for classic generators in AutoRest.", + "scripts": { + "start": "dotnet src/bin/netcoreapp2.0/autorest.java.dll --server", + "test": "gulp test", + "build": "gulp build", + "prepare": "gulp build", + "clean": "gulp clean", + "nuke": "git clean -xdf" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/autorest.java" + }, + "readme": "https://github.com/Azure/autorest.java/readme.md", + "keywords": [ + "autorest", + "classic-generators", + "java" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/autorest/issues" + }, + "homepage": "https://github.com/Azure/autorest.java/blob/master/README.md", + "devDependencies": { + "coffee-script": "^1.11.1", + "dotnet-sdk-2.0.0": "^1.1.1", + "gulp": "^3.9.1", + "gulp-filter": "^5.0.0", + "gulp-line-ending-corrector": "^1.0.1", + "iced-coffee-script": "^108.0.11", + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "moment": "^2.17.1", + "run-sequence": "*", + "shx": "^0.2.2", + "through2-parallel": "^0.1.3", + "yargs": "^8.0.2", + "@microsoft.azure/autorest.testserver": "^1.9.0" + }, + "dependencies": { + "dotnet-2.0.0": "^1.1.0" + } +} diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000..57b41583a1 --- /dev/null +++ b/pom.xml @@ -0,0 +1,202 @@ + + + 4.0.0 + + com.microsoft.azure + autorest-java + 1.0.0-SNAPSHOT + pom + + AutoRest Code Generator Tests + This package contains the test for AutoRest generated Java clients. + https://github.com/Azure/autorest + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/autorest-clientruntime-for-java + scm:git:git@github.com:Azure/autorest-clientruntime-for-java.git + HEAD + + + + UTF-8 + + ${project.basedir} + + + + + microsoft + Microsoft + + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + default + + true + always + + + + + + + ossrh + Sonatype Snapshots + https://oss.sonatype.org/content/repositories/snapshots/ + true + default + + + + + + + com.microsoft.azure + azure-mgmt-resources + 1.0.0 + + + com.microsoft.rest + client-runtime + 1.0.3-SNAPSHOT + + + com.microsoft.azure + azure-client-runtime + 1.0.3-SNAPSHOT + + + commons-codec + commons-codec + 1.10 + + + commons-io + commons-io + 2.4 + test + + + junit + junit + 4.12 + test + + + junit + junit-dep + 4.11 + test + + + org.slf4j + slf4j-simple + 1.7.22 + test + + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + + com.microsoft.azure + autorest-build-tools + 1.0.0 + + + com.puppycrawl.tools + checkstyle + 6.18 + + + + checkstyle.xml + samedir=build-tools/src/main/resources + suppressions.xml + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + true + true + -Xlint:unchecked + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+
+ + + + org.apache.maven.plugins + maven-resources-plugin + 2.4.3 + + + org.apache.maven.plugins + maven-surefire-plugin + 2.18.1 + + + **/Test*.java + **/*Test.java + **/*Tests.java + **/*TestCase.java + + + + + org.apache.maven.plugins + maven-release-plugin + 2.5.2 + + + +
+ + test/vanilla + test/azure + test/azurefluent + +
diff --git a/src/Program.cs b/src/Program.cs new file mode 100644 index 0000000000..8fc92517bc --- /dev/null +++ b/src/Program.cs @@ -0,0 +1,173 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using AutoRest.Core; +using AutoRest.Core.Extensibility; +using AutoRest.Core.Model; +using AutoRest.Core.Parsing; +using AutoRest.Core.Utilities; +using Microsoft.Perks.JsonRPC; + +using IAnyPlugin = AutoRest.Core.Extensibility.IPlugin, AutoRest.Core.ITransformer, AutoRest.Core.CodeGenerator, AutoRest.Core.CodeNamer, AutoRest.Core.Model.CodeModel>; + +namespace AutoRest.Java +{ + public static class ExtensionsLoader + { + public static IAnyPlugin GetPlugin(string name) + { + switch (name) + { + case "Java": return new AutoRest.Java.PluginJv(); + case "Azure.Java": return new AutoRest.Java.Azure.PluginJva(); + case "Azure.Java.Fluent": return new AutoRest.Java.Azure.PluginJvaf(); + } + throw new Exception("Unknown plugin: " + name); + } + } + + public class Program : NewPlugin + { + public static int Main(string[] args ) + { + if(args != null && args.Length > 0 && args[0] == "--server") { + var connection = new Connection(Console.Out, Console.OpenStandardInput()); + connection.Dispatch>("GetPluginNames", async () => new []{ "java" }); + connection.Dispatch("Process", (plugin, sessionId) => new Program(connection, plugin, sessionId).Process()); + connection.DispatchNotification("Shutdown", connection.Stop); + + // wait for something to do. + connection.GetAwaiter().GetResult(); + + Console.Error.WriteLine("Shutting Down"); + return 0; + } + Console.WriteLine("This is not an entry point."); + Console.WriteLine("Please invoke this extension through AutoRest."); + return 1; + } + + private string plugin; + + public Program(Connection connection, string plugin, string sessionId) : base(connection, sessionId) + { + this.plugin = plugin; + } + + private T GetXmsCodeGenSetting(CodeModel codeModel, string name) + { + try + { + return (T)Convert.ChangeType( + codeModel.CodeGenExtensions[name], + typeof(T).GenericTypeArguments.Length == 0 ? typeof(T) : typeof(T).GenericTypeArguments[0] // un-nullable + ); + } + catch + { + return default(T); + } + } + + protected override async Task ProcessInternal() + { + var codeGenerator = this.plugin; + + var files = await ListInputs(); + if (files.Length != 1) + { + throw new Exception($"Generator received incorrect number of inputs: {files.Length} : {string.Join(",", files)}"); + } + var modelAsJson = (await ReadFile(files[0])).EnsureYamlIsJson(); + var codeModelT = new ModelSerializer().Load(modelAsJson); + + // get internal name + var language = new[] { + "CSharp", + "Ruby", + "NodeJS", + "Python", + "Go", + "Php", + "Java", + "AzureResourceSchema", + "JsonRpcClient" } + .Where(x => x.ToLowerInvariant() == codeGenerator) + .First(); + + // build settings + var altNamespace = (await GetValue("input-file") ?? new[] { "" }).FirstOrDefault()?.Split('/').Last().Split('\\').Last().Split('.').First(); + + new Settings + { + Namespace = await GetValue("namespace"), + ClientName = GetXmsCodeGenSetting(codeModelT, "name") ?? await GetValue("override-client-name"), + PayloadFlatteningThreshold = GetXmsCodeGenSetting(codeModelT, "ft") ?? await GetValue("payload-flattening-threshold") ?? 0, + AddCredentials = await GetValue("add-credentials") ?? false, + Host = this + }; + var header = await GetValue("license-header"); + if (header != null) + { + Settings.Instance.Header = header; + } + Settings.Instance.CustomSettings.Add("InternalConstructors", GetXmsCodeGenSetting(codeModelT, "internalConstructors") ?? await GetValue("use-internal-constructors") ?? false); + Settings.Instance.CustomSettings.Add("SyncMethods", GetXmsCodeGenSetting(codeModelT, "syncMethods") ?? await GetValue("sync-methods") ?? "essential"); + Settings.Instance.CustomSettings.Add("UseDateTimeOffset", GetXmsCodeGenSetting(codeModelT, "useDateTimeOffset") ?? await GetValue("use-datetimeoffset") ?? false); + Settings.Instance.CustomSettings["ClientSideValidation"] = await GetValue("client-side-validation") ?? false; + int defaultMaximumCommentColumns = codeGenerator == "go" ? 120 : Settings.DefaultMaximumCommentColumns; + Settings.Instance.MaximumCommentColumns = await GetValue("max-comment-columns") ?? defaultMaximumCommentColumns; + Settings.Instance.OutputFileName = await GetValue("output-file"); + if (codeGenerator == "csharp") + { + Settings.Instance.Header = $"\n{Settings.Instance.Header}\n"; + } + if (codeGenerator == "ruby" || codeGenerator == "python") + { + // TODO: sort out matters here entirely instead of relying on Input being read somewhere... + var inputFile = await GetValue("input-file"); + Settings.Instance.Input = inputFile.FirstOrDefault(); + Settings.Instance.PackageName = await GetValue("package-name"); + Settings.Instance.PackageVersion = await GetValue("package-version"); + } + if (codeGenerator == "go") + { + Settings.Instance.PackageVersion = await GetValue("package-version"); + } + + // process + var plugin = ExtensionsLoader.GetPlugin( + (await GetValue("azure-arm") ?? false ? "Azure." : "") + + language + + (await GetValue("fluent") ?? false ? ".Fluent" : "") + + (await GetValue("testgen") ?? false ? ".TestGen" : "")); + Settings.PopulateSettings(plugin.Settings, Settings.Instance.CustomSettings); + + using (plugin.Activate()) + { + Settings.Instance.Namespace = Settings.Instance.Namespace ?? CodeNamer.Instance.GetNamespaceName(altNamespace); + var codeModel = plugin.Serializer.Load(modelAsJson); + codeModel = plugin.Transformer.TransformCodeModel(codeModel); + if (await GetValue("sample-generation") ?? false) + { + plugin.CodeGenerator.GenerateSamples(codeModel).GetAwaiter().GetResult(); + } + else + { + plugin.CodeGenerator.Generate(codeModel).GetAwaiter().GetResult(); + } + } + + // write out files + var outFS = Settings.Instance.FileSystemOutput; + var outFiles = outFS.GetFiles("", "*", System.IO.SearchOption.AllDirectories); + foreach (var outFile in outFiles) + { + WriteFile(outFile, outFS.ReadAllText(outFile), null); + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/autorest.java.csproj b/src/autorest.java.csproj new file mode 100644 index 0000000000..06c6e33d46 --- /dev/null +++ b/src/autorest.java.csproj @@ -0,0 +1,97 @@ + + # 2>nul || type %~df0|C:\Windows\system32\find.exe /v "setlocal"|C:\Windows\system32\find.exe /v "errorlevel"|powershell.exe -noninteractive -& exit %errorlevel% || # + + + autorest.java + autorest.extension + 1.2.2 + + true + $(MsBuildThisFileDirectory) + $(Common)../ + + Copyright (c) Microsoft Corporation + + http://go.microsoft.com/fwlink/?LinkID=288890 + https://github.com/Azure/AutoRest + https://raw.githubusercontent.com/Microsoft/dotnet/master/LICENSE + true + + + + Exe + netcoreapp2.0 + netcoreapp2.0 + AutoRest.Java + + $(MSBuildProjectDirectory)/bin + $(BaseOutputPath) + + + + + + + + + + + $(Powershell) + # + # modify resgen'd designer files for netframework1.4 + # + cmd /c dir /s /b *.designer.cs |% { dir $_ } |% { + $content = (Get-Content "$_" -Raw ) + if ( -not ($content -match "using System.Reflection") -and ($content -match "This class was auto-generated by the StronglyTypedResourceBuilder") ) { + write-host -fore green updating $_ + $content = $content -replace "(using System;)", "`$1`n using System.Reflection;" -replace "(typeof\(.*\)).Assembly", "`$1.GetTypeInfo().Assembly" + Set-Content -value $content -path $_ + } + } + + + + + + + + + + + + + + + + + + + + All + + + + + + + $(Powershell) + $path = "$(BaseOutputPath)/netcoreapp2.0/$(TargetName).deps.json" + $content = (Get-Content "$path" -Raw ) + $content = $content -replace ' "System.ComponentModel.Primitives/', ' "System.ComponentModel.Primitives.Nope/' + $content = $content -replace ' "System.Linq/', ' "System.Linq.Nope/' + $content = $content -replace ' "System.Net.Http/', ' "System.Net.Http.Nope/' + $content = $content -replace ' "System.Text.RegularExpressions/', ' "System.Text.RegularExpressions.Nope/' + $content = $content -replace ' "System.Threading.Thread/', ' "System.Threading.Thread.Nope/' + $content = $content -replace ' "System.Threading/', ' "System.Threading.Nope/' + $content = $content -replace ' "System.Xml.XDocument/', ' "System.Xml.XDocument.Nope/' + Set-Content -value $content -path $path + + + + + \ No newline at end of file diff --git a/src/azure/ClientModelExtensions.cs b/src/azure/ClientModelExtensions.cs new file mode 100644 index 0000000000..98557f9740 --- /dev/null +++ b/src/azure/ClientModelExtensions.cs @@ -0,0 +1,16 @@ +using AutoRest.Core.Model; +using AutoRest.Extensions.Azure; + +namespace AutoRest.Java.Azure +{ + public static class ClientModelExtensions + { + public static bool IsResource(this IModelType type) + { + CompositeType compositeType = type as CompositeType; + return compositeType != null && (type.Name == "Resource" || type.Name == "SubResource") && + compositeType.Extensions.ContainsKey(AzureExtensions.AzureResourceExtension) && + (bool)compositeType.Extensions[AzureExtensions.AzureResourceExtension]; + } + } +} diff --git a/src/azure/CodeGeneratorJva.cs b/src/azure/CodeGeneratorJva.cs new file mode 100644 index 0000000000..4c16e90542 --- /dev/null +++ b/src/azure/CodeGeneratorJva.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using AutoRest.Core; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Extensions; +using AutoRest.Extensions.Azure; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.azure.Templates; +using AutoRest.Java.Model; +using AutoRest.Java.vanilla.Templates; +using System; + +namespace AutoRest.Java.Azure +{ + public class CodeGeneratorJva : CodeGeneratorJv + { + private const string ClientRuntimePackage = "com.microsoft.azure:azure-client-runtime:1.0.0-beta6-SNAPSHOT from snapshot repo https://oss.sonatype.org/content/repositories/snapshots/"; + private const string _packageInfoFileName = "package-info.java"; + + public override bool IsSingleFileGenerationSupported => true; + + public override string UsageInstructions => $"The {ClientRuntimePackage} maven dependency is required to execute the generated code."; + + /// + /// Generates Azure Java code for service client. + /// + /// + /// + public override async Task Generate(CodeModel cm) + { + // get Azure Java specific codeModel + var codeModel = cm as CodeModelJva; + if (codeModel == null) + { + throw new InvalidCastException("CodeModel is not a Azure Java CodeModel"); + } + + // Service client + var serviceClientTemplate = new AzureServiceClientTemplate { Model = codeModel }; + await Write(serviceClientTemplate, $"{Path.Combine("implementation", codeModel.Name.ToPascalCase() + "Impl")}{ImplementationFileExtension}"); + + // Service client interface + var serviceClientInterfaceTemplate = new AzureServiceClientInterfaceTemplate { Model = codeModel }; + await Write(serviceClientInterfaceTemplate, $"{cm.Name.ToPascalCase()}{ImplementationFileExtension}"); + + // operations + foreach (MethodGroupJva methodGroup in codeModel.AllOperations) + { + // Operation + var operationsTemplate = new AzureMethodGroupTemplate { Model = methodGroup }; + await Write(operationsTemplate, $"{Path.Combine("implementation", methodGroup.TypeName.ToPascalCase())}Impl{ImplementationFileExtension}"); + + // Operation interface + var operationsInterfaceTemplate = new AzureMethodGroupInterfaceTemplate { Model = methodGroup }; + await Write(operationsInterfaceTemplate, $"{methodGroup.TypeName.ToPascalCase()}{ImplementationFileExtension}"); + } + + //Models + foreach (CompositeTypeJva modelType in cm.ModelTypes.Concat(codeModel.HeaderTypes)) + { + if (modelType.Extensions.ContainsKey(AzureExtensions.ExternalExtension) && + (bool)modelType.Extensions[AzureExtensions.ExternalExtension]) + { + continue; + } + if (modelType.IsResource) + { + continue; + } + + var modelTemplate = new ModelTemplate { Model = modelType }; + await Write(modelTemplate, Path.Combine("models", $"{modelType.Name.ToPascalCase()}{ImplementationFileExtension}")); + } + + //Enums + foreach (EnumTypeJva enumType in cm.EnumTypes) + { + var enumTemplate = new EnumTemplate { Model = enumType }; + await Write(enumTemplate, Path.Combine("models", $"{enumTemplate.Model.Name.ToPascalCase()}{ImplementationFileExtension}")); + } + + // Page class + foreach (var pageClass in codeModel.pageClasses) + { + var pageTemplate = new PageTemplate + { + Model = new PageJva(pageClass.Value, pageClass.Key.Key, pageClass.Key.Value), + }; + await Write(pageTemplate, Path.Combine("models", $"{pageTemplate.Model.TypeDefinitionName.ToPascalCase()}{ImplementationFileExtension}")); + } + + // Exceptions + foreach (CompositeTypeJv exceptionType in codeModel.ErrorTypes) + { + if (exceptionType.Name == "CloudError") + { + continue; + } + + var exceptionTemplate = new ExceptionTemplate { Model = exceptionType }; + await Write(exceptionTemplate, Path.Combine("models", $"{exceptionTemplate.Model.ExceptionTypeDefinitionName}{ImplementationFileExtension}")); + } + + // package-info.java + await Write(new PackageInfoTemplate + { + Model = new PackageInfoTemplateModel(cm) + }, _packageInfoFileName); + await Write(new PackageInfoTemplate + { + Model = new PackageInfoTemplateModel(cm, "implementation") + }, Path.Combine("implementation", _packageInfoFileName)); + await Write(new PackageInfoTemplate + { + Model = new PackageInfoTemplateModel(cm, "models") + }, Path.Combine("models", _packageInfoFileName)); + } + } +} diff --git a/src/azure/CodeNamerJva.cs b/src/azure/CodeNamerJva.cs new file mode 100644 index 0000000000..a6de479c86 --- /dev/null +++ b/src/azure/CodeNamerJva.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using AutoRest.Core.Model; +using AutoRest.Extensions; +using AutoRest.Extensions.Azure; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using static AutoRest.Core.Utilities.DependencyInjection; + +namespace AutoRest.Java.Azure +{ + public class CodeNamerJva : CodeNamerJv + { + public override string GetMethodGroupName(string name) + { + if (string.IsNullOrWhiteSpace(name)) + { + return name; + } + name = PascalCase(name); + return name; + } + } +} \ No newline at end of file diff --git a/src/azure/GlobalSuppressions.cs b/src/azure/GlobalSuppressions.cs new file mode 100644 index 0000000000..3b216ec3e1 --- /dev/null +++ b/src/azure/GlobalSuppressions.cs @@ -0,0 +1,65 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. +// +// To add a suppression to this file, right-click the message in the +// Code Analysis results, point to "Suppress Message", and click +// "In Suppression File". +// You do not need to add suppressions to this file manually. + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "AutoRest.Java")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ExceptionStatements")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#InterfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.Azure.AzureServiceClientTemplateModel.#InterfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "AutoRest.Java.Azure.PageTemplateModel.#ImportList")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "AutoRest.Java.Azure.AzureServiceClientTemplateModel.#SetDefaultHeaders")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getNextPageLink", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getBody", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getItems", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "addAll", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getItems", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "serviceCallback", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getBody", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "PagingBahavior", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "ListOperationCallback", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getNextPageLink", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "ServiceResponse", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getResponse", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "ServiceFuture", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#CallbackDocumentation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "param", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#CallbackDocumentation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "serviceFuture", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#CallbackDocumentation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#CallbackDocumentation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.Append(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#CallbackDocumentation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "ServiceCallback", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#CallbackDocumentation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "serviceCallback", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#CallbackDocumentation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.Azure.AzureJavaCodeNamer.#ImportType(AutoRest.Core.ClientModel.IType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.Azure.AzureJavaCodeNamer.#ImportType(AutoRest.Core.ClientModel.IType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.Azure.AzureCompositeTypeModel.#_azureRuntimePackage")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.Azure.AzureCompositeTypeModel.#.ctor(AutoRest.Java.CompositeTypeModel)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.Azure.AzureJavaCodeGenerator.#.ctor(AutoRest.Core.Settings)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.Azure.AzureModelTemplateModel.#.ctor(AutoRest.Core.ClientModel.CompositeType,AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#ResponseGeneration(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "serviceCallback", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getItems", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getBody", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "PagingBahavior", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getNextPageLink", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "ListOperationCallback", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#.ctor(AutoRest.Core.ClientModel.Method,AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.Azure.AzureJavaCodeNamer.#NormalizeTopLevelTypes(AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodGroupTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.Azure.AzureServiceClientTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.Azure.AzureSequenceTypeModel.#_azureRuntimePackage")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.Azure.AzureMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel,System.Boolean)")] + diff --git a/src/azure/Model/CodeModelJva.cs b/src/azure/Model/CodeModelJva.cs new file mode 100644 index 0000000000..c21b0169cf --- /dev/null +++ b/src/azure/Model/CodeModelJva.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Linq; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Model; +using AutoRest.Core.Utilities.Collections; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Model +{ + public class CodeModelJva : CodeModelJv + { + public IDictionary, string> pageClasses = + new Dictionary, string>(); + + public const string ExternalExtension = "x-ms-external"; + + [JsonIgnore] + public IEnumerable PropertiesEx => Properties.Where(p => p.ModelType.Name != "ServiceClientCredentials"); + + [JsonIgnore] + public virtual string ParentDeclaration + { + get + { + return " extends AzureServiceClient implements " + Name; + } + } + + [JsonIgnore] + public override List InterfaceImports + { + get + { + var imports = base.InterfaceImports; + imports.Add("com.microsoft.azure.AzureClient"); + return imports.OrderBy(i => i).ToList(); + } + } + + [JsonIgnore] + public override IEnumerable ImplImports + { + get + { + var imports = base.ImplImports.ToList(); + imports.Add("com.microsoft.azure.AzureClient"); + imports.Remove("com.microsoft.rest.ServiceClient"); + imports.Remove("okhttp3.OkHttpClient"); + imports.Remove("retrofit2.Retrofit"); + imports.Add("com.microsoft.azure.AzureServiceClient"); + return imports.OrderBy(i => i).ToList(); + } + } + + [JsonIgnore] + public string SetDefaultHeaders + { + get + { + return ""; + } + } + } +} \ No newline at end of file diff --git a/src/azure/Model/CompositeTypeJva.cs b/src/azure/Model/CompositeTypeJva.cs new file mode 100644 index 0000000000..eaf9c2f34b --- /dev/null +++ b/src/azure/Model/CompositeTypeJva.cs @@ -0,0 +1,97 @@ +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Extensions; +using AutoRest.Extensions.Azure; +using AutoRest.Java.Model; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Linq; + +namespace AutoRest.Java.Azure.Model +{ + public class CompositeTypeJva : CompositeTypeJv + { + public CompositeTypeJva() + { + } + + public CompositeTypeJva(string name) : base(name) + { + } + + protected string _azureRuntimePackage = "com.microsoft.azure"; + + [JsonIgnore] + public override string Package => IsResource + ? _azureRuntimePackage + : base.Package.Replace(".models", ""); + + [JsonIgnore] + public bool IsResource => + (Name.RawValue == "Resource" || Name.RawValue == "SubResource") && + Extensions.ContainsKey(AzureExtensions.AzureResourceExtension) && (bool)Extensions[AzureExtensions.AzureResourceExtension]; + + [JsonIgnore] + public override string ExceptionTypeDefinitionName + { + get + { + if (this.Extensions.ContainsKey(SwaggerExtensions.NameOverrideExtension)) + { + var ext = this.Extensions[SwaggerExtensions.NameOverrideExtension] as Newtonsoft.Json.Linq.JContainer; + if (ext != null && ext["name"] != null) + { + return ext["name"].ToString(); + } + } + return this.Name + "Exception"; + } + } + + [JsonIgnore] + public override IEnumerable Imports + { + get + { + var imports = new List(); + if (Name.Contains('<')) + { + imports.AddRange(ParseGenericType().SelectMany(t => t.Imports)); + } + else + { + if (IsResource || Extensions.Get(ExternalExtension) == true) + { + imports.Add(string.Join(".", Package, Name)); + } + else + { + imports.Add(string.Join(".", Package, "models", Name)); + } + } + return imports; + } + } + + [JsonIgnore] + public override IEnumerable ImportList + { + get + { + var imports = base.ImportList.ToList(); + foreach (var property in this.Properties) + { + if (property.ModelType.IsResource()) + { + imports.Add("com.microsoft.azure." + property.ModelType.Name); + } + } + if (this.BaseModelType != null && (this.BaseModelType.Name == "Resource" || this.BaseModelType.Name == "SubResource")) + { + imports.Add("com.microsoft.azure." + BaseModelType.Name); + } + return imports.Distinct(); + } + } + } +} diff --git a/src/azure/Model/EnumTypeJva.cs b/src/azure/Model/EnumTypeJva.cs new file mode 100644 index 0000000000..26f3f6a216 --- /dev/null +++ b/src/azure/Model/EnumTypeJva.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using AutoRest.Core.Model; +using AutoRest.Java.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Model +{ + public class EnumTypeJva : EnumTypeJv + { + [JsonIgnore] + public override string ModelsPackage => ".models"; + } +} \ No newline at end of file diff --git a/src/azure/Model/MethodGroupJva.cs b/src/azure/Model/MethodGroupJva.cs new file mode 100644 index 0000000000..b5d791a0a5 --- /dev/null +++ b/src/azure/Model/MethodGroupJva.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Linq; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Model; + +namespace AutoRest.Java.Azure.Model +{ + public class MethodGroupJva : MethodGroupJv + { + public const string ExternalExtension = "x-ms-external"; + + public MethodGroupJva() + { + } + public MethodGroupJva(string name) : base(name) + { + } + } +} \ No newline at end of file diff --git a/src/azure/Model/MethodJva.cs b/src/azure/Model/MethodJva.cs new file mode 100644 index 0000000000..47ba10eec0 --- /dev/null +++ b/src/azure/Model/MethodJva.cs @@ -0,0 +1,803 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Extensions; +using AutoRest.Extensions.Azure; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using AutoRest.Core.Utilities.Collections; +using static AutoRest.Core.Utilities.DependencyInjection; +using Newtonsoft.Json; +using System.Text.RegularExpressions; +using System.Text; + +namespace AutoRest.Java.Azure.Model +{ + public class MethodJva : MethodJv + { + [JsonIgnore] + public string ClientRequestIdString => AzureExtensions.GetClientRequestIdString(this); + + [JsonIgnore] + public string RequestIdString => AzureExtensions.GetRequestIdString(this); + + /// + /// Returns true if method has x-ms-long-running-operation extension. + /// + [JsonIgnore] + public bool IsLongRunningOperation + { + get { return Extensions.ContainsKey(AzureExtensions.LongRunningExtension); } + } + + [JsonIgnore] + public bool IsPagingNextOperation + { + get { return Extensions.ContainsKey("nextLinkMethod") && (bool) Extensions["nextLinkMethod"]; } + } + + [JsonIgnore] + public bool IsPagingOperation => Extensions.ContainsKey(AzureExtensions.PageableExtension) && + Extensions[AzureExtensions.PageableExtension] != null && + !IsPagingNextOperation; + + [JsonIgnore] + public bool IsPagingNonPollingOperation => Extensions.ContainsKey(AzureExtensions.PageableExtension) && + Extensions[AzureExtensions.PageableExtension] == null && + !IsPagingNextOperation; + + [JsonIgnore] + public bool SimulateAsPagingOperation { set; get; } = false; + + [JsonIgnore] + public ResponseJva ReturnTypeJva => ReturnType as ResponseJva; + + /// + /// Get the type for operation exception. + /// + [JsonIgnore] + public override string OperationExceptionTypeString + { + get + { + if (DefaultResponse.Body == null || DefaultResponse.Body.Name == "CloudError") + { + return "CloudException"; + } + else if (this.DefaultResponse.Body is CompositeType) + { + CompositeTypeJva type = this.DefaultResponse.Body as CompositeTypeJva; + return type.ExceptionTypeDefinitionName; + } + else + { + return "RestException"; + } + } + } + + [JsonIgnore] + public override IEnumerable RetrofitParameters + { + get + { + List parameters = base.RetrofitParameters.ToList(); + var par = new ParameterJv + { + SerializedName = "User-Agent", + Location = ParameterLocation.Header, + ModelType = new PrimaryTypeJv(KnownPrimaryType.String), + ClientProperty = new PropertyJv + { + Name = "userAgent" + } + }; + par.Name.FixedValue = Group.IsNullOrEmpty() ? "this.userAgent()" : "this.client.userAgent()"; + parameters.Add(par); + + if (IsPagingNextOperation) + { + parameters.RemoveAll(p => p.Location == ParameterLocation.Path); + parameters.Insert(0, new ParameterJv + { + Name = "nextUrl", + SerializedName = "nextUrl", + ModelType = New(KnownPrimaryType.String), + Documentation = "The URL to get the next page of items.", + Location = ParameterLocation.Path, + IsRequired = true + }); + } + + return parameters; + } + } + + [JsonIgnore] + public override string MethodParameterApiDeclaration + { + get + { + var declaration = base.MethodParameterApiDeclaration; + if (IsPagingNextOperation) + { + declaration = declaration.Replace("@Path(\"nextUrl\")", "@Url"); + } + foreach (var parameter in RetrofitParameters.Where(p => + p.Location == ParameterLocation.Path || p.Location == ParameterLocation.Query)) + { + if (parameter.Extensions.ContainsKey(AzureExtensions.SkipUrlEncodingExtension) && + (bool) parameter.Extensions[AzureExtensions.SkipUrlEncodingExtension] == true) + { + declaration = declaration.Replace( + string.Format(CultureInfo.InvariantCulture, "@{0}(\"{1}\")", parameter.Location.ToString(), parameter.SerializedName), + string.Format(CultureInfo.InvariantCulture, "@{0}(value = \"{1}\", encoded = true)", parameter.Location.ToString(), parameter.SerializedName)); + } + } + return declaration; + } + } + + [JsonIgnore] + public override string MethodParameterDeclaration + { + get + { + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + List declarations = new List(); + foreach (var parameter in LocalParameters.Where(p => !p.IsConstant)) + { + declarations.Add("final " + parameter.ClientType.ParameterVariant.Name + " " + parameter.Name); + } + + var declaration = string.Join(", ", declarations); + return declaration; + } + return base.MethodParameterDeclaration; + } + } + + [JsonIgnore] + public override string MethodRequiredParameterDeclaration + { + get + { + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + List declarations = new List(); + foreach (var parameter in LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) + { + declarations.Add("final " + parameter.ClientType.ParameterVariant.Name + " " + parameter.Name); + } + + var declaration = string.Join(", ", declarations); + return declaration; + } + return base.MethodRequiredParameterDeclaration; + } + } + + [JsonIgnore] + public override string MethodParameterDeclarationWithCallback + { + get + { + var parameters = MethodParameterDeclaration; + if (!parameters.IsNullOrEmpty()) + { + parameters += ", "; + } + if (this.IsPagingOperation) + { + parameters += string.Format(CultureInfo.InvariantCulture, "final ListOperationCallback<{0}> serviceCallback", + ReturnTypeJva.SequenceElementTypeString); + } + else if (this.IsPagingNextOperation) + { + parameters += string.Format(CultureInfo.InvariantCulture, "final ServiceFuture<{0}> serviceFuture, final ListOperationCallback<{1}> serviceCallback", + ReturnTypeJva.ServiceFutureGenericParameterString, ReturnTypeJva.SequenceElementTypeString); + } + else + { + parameters += string.Format(CultureInfo.InvariantCulture, "final ServiceCallback<{0}> serviceCallback", ReturnTypeJva.GenericBodyClientTypeString); + } + + return parameters; + } + } + + [JsonIgnore] + public override string MethodRequiredParameterDeclarationWithCallback + { + get + { + var parameters = MethodRequiredParameterDeclaration; + if (!parameters.IsNullOrEmpty()) + { + parameters += ", "; + } + if (this.IsPagingOperation) + { + parameters += string.Format(CultureInfo.InvariantCulture, "final ListOperationCallback<{0}> serviceCallback", + ReturnTypeJva.SequenceElementTypeString); + } + else if (this.IsPagingNextOperation) + { + parameters += string.Format(CultureInfo.InvariantCulture, "final ServiceFuture<{0}> serviceFuture, final ListOperationCallback<{1}> serviceCallback", + ReturnTypeJva.ServiceFutureGenericParameterString, ReturnTypeJva.SequenceElementTypeString); + } + else + { + parameters += string.Format(CultureInfo.InvariantCulture, "final ServiceCallback<{0}> serviceCallback", ReturnTypeJva.GenericBodyClientTypeString); + } + + return parameters; + } + } + + [JsonIgnore] + public override string MethodParameterInvocationWithCallback + { + get + { + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + return base.MethodParameterInvocationWithCallback.Replace("serviceCallback", "serviceFuture, serviceCallback"); + } + return base.MethodParameterInvocationWithCallback; + } + } + + [JsonIgnore] + public override string MethodRequiredParameterInvocationWithCallback + { + get + { + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + return base.MethodRequiredParameterInvocationWithCallback.Replace("serviceCallback", "serviceFuture, serviceCallback"); + } + return base.MethodRequiredParameterInvocationWithCallback; + } + } + + [JsonIgnore] + public override bool IsParameterizedHost => + (CodeModel?.Extensions?.ContainsKey(SwaggerExtensions.ParameterizedHostExtension) ?? false) && + !IsPagingNextOperation; + + [JsonIgnore] + public override IEnumerable Exceptions + { + get + { + var exceptions = base.Exceptions.ToList(); + if (this.IsLongRunningOperation) + { + exceptions.Add("InterruptedException"); + } + return exceptions; + } + } + + [JsonIgnore] + public override List ExceptionStatements + { + get + { + List exceptions = base.ExceptionStatements; + if (this.IsLongRunningOperation) + { + exceptions.Add("InterruptedException exception thrown when long running operation is interrupted"); + } + return exceptions; + } + } + + [JsonIgnore] + public string PollingMethod + { + get + { + string method; + if (this.HttpMethod == HttpMethod.Put || this.HttpMethod == HttpMethod.Patch) + { + method = "getPutOrPatchResult"; + } + else if (this.HttpMethod == HttpMethod.Delete || this.HttpMethod == HttpMethod.Post) + { + method = "getPostOrDeleteResult"; + } + else + { + throw new InvalidOperationException("Invalid long running operation HTTP method " + this.HttpMethod); + } + if (ReturnType.Headers != null) + { + method += "WithHeaders"; + } + return method; + } + } + + [JsonIgnore] + public string PollingResourceTypeArgs + { + get + { + string args = "new TypeToken<" + ReturnTypeJva.GenericBodyClientTypeString + ">() { }.getType()"; + if (ReturnType.Headers != null) + { + args += ", " + ReturnTypeJva.HeaderWireType.Name + ".class"; + } + return args; + } + } + + [JsonIgnore] + public override string ResponseBuilder + { + get + { + return "AzureResponseBuilder"; + } + } + + [JsonIgnore] + public override string ReturnTypeResponseName => + ReturnTypeJv?.BodyClientType?.ServiceResponseVariant()?.Name; + + public string PagingGroupedParameterTransformation(bool filterRequired = false) + { + var builder = new IndentedStringBuilder(); + if (IsPagingOperation) + { + string invocation; + MethodJva nextMethod = GetPagingNextMethodWithInvocation(out invocation); + TransformPagingGroupedParameter(builder, nextMethod, filterRequired); + } + return builder.ToString(); + } + + public string NextMethodParameterInvocation(bool filterRequired = false) + { + string invocation; + MethodJva nextMethod = GetPagingNextMethodWithInvocation(out invocation); + if (filterRequired) + { + if (this.InputParameterTransformation.IsNullOrEmpty() || nextMethod.InputParameterTransformation.IsNullOrEmpty()) + { + return nextMethod.MethodDefaultParameterInvocation; + } + var groupedType = this.InputParameterTransformation.First().ParameterMappings[0].InputParameter; + var nextGroupType = nextMethod.InputParameterTransformation.First().ParameterMappings[0].InputParameter; + List invocations = new List(); + foreach (var parameter in nextMethod.LocalParameters) + { + if (parameter.IsRequired) + { + invocations.Add(parameter.Name); + } + else if (parameter.Name == nextGroupType.Name && groupedType.IsRequired) + { + invocations.Add(parameter.Name); + } + else + { + invocations.Add("null"); + } + } + return string.Join(", ", invocations); + } + else + { + return nextMethod.MethodParameterInvocation; + } + } + + [JsonIgnore] + public string PagingNextPageLinkParameterName + { + get + { + string invocation; + MethodJva nextMethod = GetPagingNextMethodWithInvocation(out invocation); + return nextMethod.Parameters.First(p => p.Name.ToString().StartsWith("next", StringComparison.OrdinalIgnoreCase)).Name; + } + } + + public override string ResponseGeneration(bool filterRequired = false) + { + if (this.IsPagingOperation && !this.IsPagingNextOperation) + { + var builder = new IndentedStringBuilder(); + builder.AppendLine("{0} response = {1}Delegate(call.execute());", + ReturnTypeJva.WireResponseTypeString, this.Name); + + string invocation; + MethodJva nextMethod = GetPagingNextMethodWithInvocation(out invocation); + + builder.AppendLine("PagedList<{0}> result = new PagedList<{0}>(response.body()) {{", ((SequenceType)ReturnType.Body).ElementType.Name) + .Indent().AppendLine("@Override") + .AppendLine("public Page<{0}> nextPage(String {1}) throws {2}, IOException {{", + ((SequenceType)ReturnType.Body).ElementType.Name, + nextMethod.Parameters.First(p => p.Name.ToString().StartsWith("next", StringComparison.OrdinalIgnoreCase)).Name, + OperationExceptionTypeString) + .Indent(); + TransformPagingGroupedParameter(builder, nextMethod, filterRequired); + builder.AppendLine("return {0}({1}).body();", + invocation, filterRequired ? nextMethod.MethodDefaultParameterInvocation : nextMethod.MethodParameterInvocation) + .Outdent().AppendLine("}") + .Outdent().AppendLine("};"); + return builder.ToString(); + } + else if (this.IsPagingNonPollingOperation) + { + var returnTypeBody = ReturnType.Body as SequenceTypeJva; + var builder = new IndentedStringBuilder(); + builder.AppendLine("{0}<{1}<{2}>> response = {3}Delegate(call.execute());", + ReturnTypeJva.ClientResponseType, returnTypeBody.PageImplType, returnTypeBody.ElementType.Name, this.Name.ToCamelCase()); + builder.AppendLine("{0} result = response.body().items();", this.ReturnType.Body.Name); + return builder.ToString(); + } + else + { + return base.ResponseGeneration(); + } + } + + [JsonIgnore] + public override string ReturnValue + { + get + { + if (this.IsPagingOperation || this.IsPagingNonPollingOperation) + { + if (ReturnType.Headers != null) + { + return string.Format(CultureInfo.InvariantCulture, "new {0}<>(result, response.headers(), response.response())", + ReturnTypeJva.ClientResponseType); + } + else + { + return string.Format(CultureInfo.InvariantCulture, "new {0}<>(result, response.response())", + ReturnTypeJva.ClientResponseType); + } + } + else + { + return base.ReturnValue; + } + } + } + + public override string SuccessCallback(bool filterRequired = false) + { + if (this.IsPagingOperation) + { + var builder = new IndentedStringBuilder(); + builder.AppendLine("{0} result = {1}Delegate(response);", + ReturnTypeJva.WireResponseTypeString, this.Name); + builder.AppendLine("if (serviceCallback != null) {").Indent(); + builder.AppendLine("serviceCallback.load(result.body().items());"); + builder.AppendLine("if (result.body().nextPageLink() != null").Indent().Indent() + .AppendLine("&& serviceCallback.progress(result.body().items()) == ListOperationCallback.PagingBahavior.CONTINUE) {").Outdent(); + string invocation; + MethodJva nextMethod = GetPagingNextMethodWithInvocation(out invocation, true); + TransformPagingGroupedParameter(builder, nextMethod, filterRequired); + var nextCall = string.Format(CultureInfo.InvariantCulture, "{0}(result.body().nextPageLink(), {1});", + invocation, + filterRequired ? nextMethod.MethodRequiredParameterInvocationWithCallback : nextMethod.MethodParameterInvocationWithCallback); + builder.AppendLine(nextCall.Replace( + string.Format(", {0}", nextMethod.Parameters.First(p => p.Name.ToString().StartsWith("next", StringComparison.OrdinalIgnoreCase)).Name), + "")).Outdent(); + builder.AppendLine("} else {").Indent(); + if (ReturnType.Headers == null) + { + builder.AppendLine("serviceCallback.success(new {0}<>(serviceCallback.get(), result.response()));", ReturnTypeJva.ClientResponseType); + } + else + { + builder.AppendLine("serviceCallback.success(new {0}<>(serviceCallback.get(), result.headers(), result.response()));", ReturnTypeJva.ClientResponseType); + } + builder.Outdent().AppendLine("}").Outdent().AppendLine("}"); + if (ReturnType.Headers == null) + { + builder.AppendLine("serviceFuture.success(new {0}<>(result.body().items(), response));", ReturnTypeJva.ClientResponseType); + } + else + { + builder.AppendLine("serviceFuture.success(new {0}<>(result.body().items(), result.headers(), result.response()));", ReturnTypeJva.ClientResponseType); + } + return builder.ToString(); + } + else if (this.IsPagingNextOperation) + { + var builder = new IndentedStringBuilder(); + builder.AppendLine("{0} result = {1}Delegate(response);", ReturnTypeJva.WireResponseTypeString, this.Name); + builder.AppendLine("serviceCallback.load(result.body().items());"); + builder.AppendLine("if (result.body().nextPageLink() != null").Indent().Indent(); + builder.AppendLine("&& serviceCallback.progress(result.body().items()) == ListOperationCallback.PagingBahavior.CONTINUE) {").Outdent(); + var nextCall = string.Format(CultureInfo.InvariantCulture, "{0}Async(result.body().nextPageLink(), {1});", + this.Name, + filterRequired ? MethodRequiredParameterInvocationWithCallback : MethodParameterInvocationWithCallback); + builder.AppendLine(nextCall.Replace( + string.Format(", {0}", Parameters.First(p => p.Name.ToString().StartsWith("next", StringComparison.OrdinalIgnoreCase)).Name), + "")).Outdent(); + builder.AppendLine("} else {").Indent(); + if (ReturnType.Headers == null) + { + builder.AppendLine("serviceCallback.success(new {0}<>(serviceCallback.get(), result.response()));", ReturnTypeJva.ClientResponseType); + } + else + { + builder.AppendLine("serviceCallback.success(new {0}<>(serviceCallback.get(), result.headers(), result.response()));", ReturnTypeJva.ClientResponseType); + } + builder.Outdent().AppendLine("}"); + return builder.ToString(); + } + else if (this.IsPagingNonPollingOperation) + { + var returnTypeBody = ReturnType.Body as SequenceTypeJva; + var builder = new IndentedStringBuilder(); + builder.AppendLine("{0}<{1}<{2}>> result = {3}Delegate(response);", + ReturnTypeJva.ClientResponseType, returnTypeBody.PageImplType, returnTypeBody.ElementType.Name, this.Name.ToCamelCase()); + if (ReturnType.Headers == null) + { + builder.AppendLine("serviceCallback.success(new {0}<>(result.body().items(), result.response()));", ReturnTypeJva.ClientResponseType); + } + else + { + builder.AppendLine("serviceCallback.success(new {0}<>(result.body().items(), result.headers(), result.response()));", ReturnTypeJva.ClientResponseType); + } + return builder.ToString(); + } + return base.SuccessCallback(); + } + + private MethodJva GetPagingNextMethodWithInvocation(out string invocation, bool async = false, bool singlePage = true) + { + String methodSuffixString = "WithServiceResponse"; + if (singlePage) + { + methodSuffixString = "SinglePage"; + } + if (IsPagingNextOperation) + { + invocation = Name + methodSuffixString + (async ? "Async" : ""); + return this; + } + string name = this.Extensions.GetValue>("nextMethodName")?.ToCamelCase(); + string group = this.Extensions.GetValue>("nextMethodGroup")?.ToCamelCase(); + group = CodeNamerJva.Instance.GetMethodGroupName(group); + var methodModel = + CodeModel.Methods.FirstOrDefault(m => + (group == null ? m.Group == null : group.Equals(m.Group, StringComparison.OrdinalIgnoreCase)) + && m.Name.ToString().Equals(name, StringComparison.OrdinalIgnoreCase)) as MethodJva; + group = group.ToPascalCase(); + name = name + methodSuffixString; + if (async) + { + name = name + "Async"; + } + if (group == null || this.Group == methodModel.Group) + { + invocation = name; + } + else + { + invocation = string.Format(CultureInfo.InvariantCulture, "{0}.get{1}().{2}", ClientReference.Replace("this.", ""), group, name); + } + return methodModel; + } + + public string GetPagingNextMethodInvocation(bool async = false, bool singlePage = true) + { + string invocation; + GetPagingNextMethodWithInvocation(out invocation, async, singlePage); + return invocation; + } + + protected virtual void TransformPagingGroupedParameter(IndentedStringBuilder builder, MethodJva nextMethod, bool filterRequired = false) + { + if (this.InputParameterTransformation.IsNullOrEmpty() || nextMethod.InputParameterTransformation.IsNullOrEmpty()) + { + return; + } + var groupedType = this.InputParameterTransformation.First().ParameterMappings[0].InputParameter; + var nextGroupType = nextMethod.InputParameterTransformation.First().ParameterMappings[0].InputParameter; + if (nextGroupType.Name == groupedType.Name) + { + return; + } + var nextGroupTypeName = CodeNamerJva.Instance.GetTypeName(nextGroupType.Name); + if (filterRequired && !groupedType.IsRequired) + { + return; + } + if (!groupedType.IsRequired) + { + builder.AppendLine("{0} {1} = null;", nextGroupTypeName, nextGroupType.Name.ToCamelCase()); + builder.AppendLine("if ({0} != null) {{", groupedType.Name.ToCamelCase()); + builder.Indent(); + builder.AppendLine("{0} = new {1}();", nextGroupType.Name.ToCamelCase(), nextGroupTypeName); + } + else + { + builder.AppendLine("{1} {0} = new {1}();", nextGroupType.Name.ToCamelCase(), nextGroupTypeName); + } + foreach (var outParam in nextMethod.InputParameterTransformation.Select(t => t.OutputParameter)) + { + builder.AppendLine("{0}.with{1}({2}.{3}());", nextGroupType.Name.ToCamelCase(), outParam.Name.ToPascalCase(), groupedType.Name.ToCamelCase(), outParam.Name.ToCamelCase()); + } + if (!groupedType.IsRequired) + { + builder.Outdent().AppendLine(@"}"); + } + } + + public override string ClientResponse(bool filterRequired = false) + { + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + IndentedStringBuilder builder = new IndentedStringBuilder(); + builder.AppendLine("ServiceResponse<{0}> result = {1}Delegate(response);", ReturnTypeJva.GenericBodyWireTypeString, this.Name); + builder.AppendLine("{0} body = null;", ReturnTypeJva.ServiceFutureGenericParameterString) + .AppendLine("if (result.body() != null) {") + .Indent().AppendLine("{0}", ReturnTypeJva.ConvertBodyToClientType("result.body()", "body")) + .Outdent().AppendLine("}"); + builder.AppendLine("ServiceResponse<{0}> clientResponse = new ServiceResponse<{0}>(body, result.response());", + ReturnTypeJva.ServiceFutureGenericParameterString); + return builder.ToString(); + } + else if (this.IsPagingNonPollingOperation) + { + IndentedStringBuilder builder = new IndentedStringBuilder(); + builder.AppendLine("ServiceResponse<{0}> result = {1}Delegate(response);", ReturnTypeJva.GenericBodyWireTypeString, this.Name); + builder.AppendLine("ServiceResponse<{0}> clientResponse = new ServiceResponse<{0}>(result.body().items(), result.response());", + ReturnTypeJva.ServiceFutureGenericParameterString); + return builder.ToString(); + } + else + { + return base.ClientResponse(filterRequired); + } + } + + [JsonIgnore] + public override string ServiceFutureFactoryMethod + { + get + { + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + if (ReturnType.Headers == null) + { + return "fromPageResponse"; + } + else + { + return "fromHeaderPageResponse"; + } + } + else + { + return base.ServiceFutureFactoryMethod; + } + } + } + + [JsonIgnore] + public override string CallbackDocumentation + { + get + { + IndentedStringBuilder builder = new IndentedStringBuilder(); + if (this.IsPagingNextOperation) + { + builder.AppendLine(" * @param serviceFuture the ServiceFuture object tracking the Retrofit calls"); + } + builder.Append(" * @param serviceCallback the async ServiceCallback to handle successful and failed responses."); + return builder.ToString(); + } + } + + [JsonIgnore] + public string NextUrlConstruction + { + get + { + var builder = new StringBuilder("String.format("); + var regex = new Regex("{\\w+}"); + var matches = regex.Matches(Url); + builder.Append("\"").Append(regex.Replace(Url, "%s").TrimStart('/')).Append("\""); + foreach (Match match in matches) + { + var sn = match.Value.Trim('{', '}'); + builder.Append(", " + base.RetrofitParameters.First(p => p.SerializedName == sn).WireName); + } + return builder.Append(")").ToString(); + } + } + + [JsonIgnore] + public override string RuntimeBasePackage + { + get + { + return "com.microsoft.azure"; + } + } + + [JsonIgnore] + public override List InterfaceImports + { + get + { + var imports = base.InterfaceImports; + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + imports.Remove("com.microsoft.rest.ServiceCallback"); + imports.Add("com.microsoft.azure.ListOperationCallback"); + imports.Add("com.microsoft.azure.Page"); + imports.Add("com.microsoft.azure.PagedList"); + } + return imports; + } + } + + [JsonIgnore] + public override List ImplImports + { + get + { + var imports = base.ImplImports; + if (this.IsLongRunningOperation) + { + imports.Remove("com.microsoft.azure.AzureResponseBuilder"); + this.Responses.Select(r => r.Value.Body).Concat(new IModelType[] { DefaultResponse.Body }) + .SelectMany(t => t.ImportSafe()) + .Where(i => !this.Parameters.Any(p => p.ModelType.ImportSafe().Contains(i))) + .ForEach(i => imports.Remove(i)); + // return type may have been removed as a side effect + imports.AddRange(ReturnTypeJva.ImplImports); + } + var typeName = (ReturnTypeJva.BodyClientType as SequenceTypeJva)?.PageImplType; + CompositeType ctype = null; + if (typeName != null) + { + ctype = new CompositeTypeJva(); + ctype.Name.CopyFrom(typeName); + ctype.CodeModel = CodeModel; + } + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + imports.Remove("java.util.ArrayList"); + imports.Remove("com.microsoft.rest.ServiceCallback"); + imports.Add("com.microsoft.azure.ListOperationCallback"); + imports.Add("com.microsoft.azure.Page"); + imports.Add("com.microsoft.azure.PagedList"); + imports.Add("com.microsoft.azure.AzureServiceFuture"); + imports.AddRange(ctype.ImportSafe()); + } + if (this.IsPagingNextOperation) + { + imports.Remove("retrofit2.http.Path"); + imports.Add("retrofit2.http.Url"); + } + if (this.IsPagingNonPollingOperation) + { + imports.AddRange(ctype.ImportSafe()); + } + return imports; + } + } + } +} \ No newline at end of file diff --git a/src/azure/Model/PageJva.cs b/src/azure/Model/PageJva.cs new file mode 100644 index 0000000000..d9672d5eaf --- /dev/null +++ b/src/azure/Model/PageJva.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Linq; + +namespace AutoRest.Java.Azure.Model +{ + public class PageJva + { + public PageJva(string typeDefinitionName, string nextLinkName, string itemName) + { + this.TypeDefinitionName = typeDefinitionName; + this.NextLinkName = nextLinkName; + this.ItemName = itemName; + } + + public string NextLinkName { get; private set; } + + public string ItemName { get; private set; } + + public string TypeDefinitionName { get; private set; } + + [JsonIgnore] + public IEnumerable ImportList + { + get + { + List imports = new List(); + imports.Add("com.microsoft.azure.Page"); + imports.Add("java.util.List"); + imports.Add("com.fasterxml.jackson.annotation.JsonProperty"); + return imports.OrderBy(i => i).Distinct(); + } + } + + [JsonIgnore] + public virtual string ModelsPackage + { + get + { + return "models"; + } + } + } +} diff --git a/src/azure/Model/ResponseJva.cs b/src/azure/Model/ResponseJva.cs new file mode 100644 index 0000000000..2f6b082b6b --- /dev/null +++ b/src/azure/Model/ResponseJva.cs @@ -0,0 +1,127 @@ +using System.Globalization; +using AutoRest.Core.Model; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Model +{ + public class ResponseJva : ResponseJv + { + public ResponseJva() + { + } + + public ResponseJva(IModelTypeJv body, IModelTypeJv headers) + : base(body, headers) + { + } + + public MethodJva Parent { get; set; } + + [JsonIgnore] + public bool IsPagedResponse => Parent.IsPagingNextOperation || Parent.IsPagingOperation; + + [JsonIgnore] + public override IModelTypeJv BodyClientType + { + get + { + var bodySequenceType = base.BodyClientType as SequenceTypeJva; + if (bodySequenceType != null && IsPagedResponse) + { + var result = new SequenceTypeJva + { + ElementType = bodySequenceType.ElementType, + PageImplType = bodySequenceType.PageImplType + }; + result.Name.OnGet += name => $"Paged{name}"; + return result; + } + return base.BodyClientType; + } + } + + [JsonIgnore] + public override string GenericBodyClientTypeString + { + get + { + var bodySequenceType = base.BodyClientType as SequenceTypeJva; + if (bodySequenceType != null && IsPagedResponse) + { + return string.Format(CultureInfo.InvariantCulture, "PagedList<{0}>", bodySequenceType.ElementType.Name); + } + return base.GenericBodyClientTypeString; + } + } + + [JsonIgnore] + public override string ServiceFutureGenericParameterString + { + get + { + var bodySequenceType = base.BodyClientType as SequenceTypeJva; + if (bodySequenceType != null && IsPagedResponse) + { + return string.Format(CultureInfo.InvariantCulture, "List<{0}>", bodySequenceType.ElementType.Name); + } + return GenericBodyClientTypeString; + } + } + + [JsonIgnore] + public override string ServiceResponseGenericParameterString + { + get + { + var bodySequenceType = base.BodyClientType as SequenceTypeJva; + if (bodySequenceType != null && IsPagedResponse) + { + return string.Format(CultureInfo.InvariantCulture, "Page<{0}>", bodySequenceType.ElementType.Name); + } + return GenericBodyClientTypeString; + } + } + + [JsonIgnore] + public override string GenericBodyWireTypeString + { + get + { + var sequenceType = base.BodyClientType as SequenceTypeJva; + if (sequenceType != null && (IsPagedResponse || Parent.IsPagingNonPollingOperation)) + { + return string.Format(CultureInfo.InvariantCulture, "{0}<{1}>", sequenceType.PageImplType, sequenceType.ElementType.Name); + } + return base.GenericBodyWireTypeString; + } + } + + [JsonIgnore] + public override string ClientCallbackTypeString + { + get + { + if (Body is SequenceType && IsPagedResponse) + { + return BodyClientType.Name; + } + return base.ClientCallbackTypeString; + } + } + + [JsonIgnore] + public override string ObservableClientResponseTypeString + { + get + { + if (IsPagedResponse) + { + return "ServiceResponse<" + ServiceResponseGenericParameterString + ">"; + } + return base.ObservableClientResponseTypeString; + } + } + } +} diff --git a/src/azure/Model/SequenceTypeJva.cs b/src/azure/Model/SequenceTypeJva.cs new file mode 100644 index 0000000000..ecc532e814 --- /dev/null +++ b/src/azure/Model/SequenceTypeJva.cs @@ -0,0 +1,13 @@ +using AutoRest.Core.Model; +using AutoRest.Java.Model; +using static AutoRest.Core.Utilities.DependencyInjection; + +namespace AutoRest.Java.Azure.Model +{ + public class SequenceTypeJva : SequenceTypeJv + { + protected string _azureRuntimePackage = "com.microsoft.azure"; + + public string PageImplType { get; set; } + } +} diff --git a/src/azure/PluginJva.cs b/src/azure/PluginJva.cs new file mode 100644 index 0000000000..800b73d412 --- /dev/null +++ b/src/azure/PluginJva.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using AutoRest.Core; +using AutoRest.Core.Extensibility; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using static AutoRest.Core.Utilities.DependencyInjection; + +namespace AutoRest.Java.Azure +{ + public sealed class PluginJva : Plugin + { + public PluginJva() + { + Context = new Context + { + // inherit base settings + Context, + + // set code model implementations our own implementations + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory() + }; + } + } +} \ No newline at end of file diff --git a/src/azure/Templates/AzureMethodGroupInterfaceTemplate.cshtml b/src/azure/Templates/AzureMethodGroupInterfaceTemplate.cshtml new file mode 100644 index 0000000000..8745c01b7c --- /dev/null +++ b/src/azure/Templates/AzureMethodGroupInterfaceTemplate.cshtml @@ -0,0 +1,32 @@ +@using System +@using AutoRest.Java.azure.Templates +@using AutoRest.Java.vanilla.Templates +@using System.Linq; +@using AutoRest.Java +@using AutoRest.Java.Model +@using AutoRest.Java.Azure.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()); +@EmptyLine +@foreach (var importClass in Model.InterfaceImports) +{ +@:import @importClass; +} +@EmptyLine + +/** + * An instance of this class provides access to all the operations defined + * in @(Model.TypeName). + */ +public interface @Model.TypeName { + @foreach (MethodJv method in Model.Methods) + { + @:@Include(new MethodInterfaceTemplate(), method) + @EmptyLine + } +} \ No newline at end of file diff --git a/src/azure/Templates/AzureMethodGroupRetrofitTemplate.cshtml b/src/azure/Templates/AzureMethodGroupRetrofitTemplate.cshtml new file mode 100644 index 0000000000..e35bbe7bc7 --- /dev/null +++ b/src/azure/Templates/AzureMethodGroupRetrofitTemplate.cshtml @@ -0,0 +1,40 @@ +@using System.Linq; +@using AutoRest.Core.Model +@using AutoRest.Core.Utilities +@using AutoRest.Java.Azure.Model +@inherits AutoRest.Core.Template +/** + * The interface defining all the services for @Model.TypeName to be + * used by Retrofit to perform actually REST calls. + */ +interface @Model.MethodGroupServiceType { +@foreach (MethodJva method in Model.Methods) +{ +if (method.RequestContentType == "multipart/form-data" || method.RequestContentType == "application/x-www-form-urlencoded") +{ +@: @@Multipart +} +else +{ +@: @@Headers({ "Content-Type: @method.RequestContentType", "x-ms-logging-context: @Model.MethodGroupFullType @method.Name" }) +} +if (method.HttpMethod == HttpMethod.Delete) +{ +@: @@HTTP(path = "@(method.Url.TrimStart('/'))", method = "DELETE", hasBody = true) +} +else if (method.IsPagingNextOperation) +{ +@: @@GET +} +else +{ +@: @@@(method.HttpMethod.ToString().ToUpper())("@(method.Url.TrimStart('/'))") +} +if (method.ReturnType.Body.IsPrimaryType(KnownPrimaryType.Stream)) +{ +@: @@Streaming +} +@: Observable> @(method.Name)(@method.MethodParameterApiDeclaration); +@EmptyLine +} +} \ No newline at end of file diff --git a/src/azure/Templates/AzureMethodGroupTemplate.cshtml b/src/azure/Templates/AzureMethodGroupTemplate.cshtml new file mode 100644 index 0000000000..125cee1dca --- /dev/null +++ b/src/azure/Templates/AzureMethodGroupTemplate.cshtml @@ -0,0 +1,62 @@ +@using System +@using AutoRest.Java.azure.Templates +@using System.Linq; +@using AutoRest.Java +@using AutoRest.Java.Azure.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()).@(Model.ImplPackage); +@EmptyLine +@foreach (var importClass in Model.ImplImports) +{ +@:import @importClass; +} +@EmptyLine + +/** + * An instance of this class provides access to all the operations defined + * in @(Model.TypeName). + */ +public class @(Model.MethodGroupImplType)@(Model.ParentDeclaration) { + /** The Retrofit service to perform REST calls. */ + private @Model.MethodGroupServiceType service; + /** The service client containing this operation class. */ + private @(Model.ServiceClientType) client; + @EmptyLine + /** + * Initializes an instance of @(Model.MethodGroupImplType). + * + * @@param retrofit the Retrofit instance built from a Retrofit Builder. + * @@param client the instance of the service client containing this operation class. + */ + public @(Model.MethodGroupImplType)(Retrofit retrofit, @(Model.ServiceClientType) client) { + this.service = retrofit.create(@(Model.MethodGroupServiceType).class); + this.client = client; + } + @EmptyLine + + @Include(new AzureMethodGroupRetrofitTemplate(), Model) + + @EmptyLine + + @foreach (MethodJva method in Model.Methods) + { + if (method.IsPagingOperation || method.IsPagingNextOperation) + { + @:@(Include(new PagingMethodTemplate(), method)) + } + else if (method.SimulateAsPagingOperation) + { + @:@(Include(new SimulatedPageMethodTemplate(), method)) + } + else + { + @:@(Include(new AzureMethodTemplate(), method)) + } + @EmptyLine + } +} diff --git a/src/azure/Templates/AzureMethodTemplate.cshtml b/src/azure/Templates/AzureMethodTemplate.cshtml new file mode 100644 index 0000000000..211a6a114c --- /dev/null +++ b/src/azure/Templates/AzureMethodTemplate.cshtml @@ -0,0 +1,269 @@ +@using System +@using AutoRest.Java +@using AutoRest.Java.vanilla.Templates +@using AutoRest.Java.azure.Templates +@using System.Linq +@using AutoRest.Core.Utilities +@using AutoRest.Java.Model +@using AutoRest.Java.Azure.Model +@inherits AutoRest.Core.Template +@if (!Model.IsLongRunningOperation) +{ +@:@(Include(new MethodTemplate(), Model as MethodJv)) +} +else +{ +if (Model.LocalParameters.Any(p => !p.IsConstant && !p.IsRequired)) +{ + +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@throws @Model.OperationExceptionTypeString thrown if the request is rejected by server + * @@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent +@if (Model.ReturnType.Body != null) +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object if successful. +} + */ +public @Model.ReturnTypeResponseName @(Model.Name)(@Model.MethodRequiredParameterDeclaration) { +@if (@Model.ReturnTypeJva.BodyClientType.ResponseVariant.Name == "void") +{ +@: @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation).toBlocking().last().body(); +} +else +{ +@: return @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation).toBlocking().last().body(); +} +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@Model.CallbackDocumentation + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the {@@link ServiceFuture} object + */ +public ServiceFuture<@Model.ReturnTypeJva.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclarationWithCallback) { + return ServiceFuture.@(Model.ServiceFutureFactoryMethod)(@(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation), serviceCallback); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the observable for the request + */ +public Observable<@Model.ReturnTypeJva.GenericBodyClientTypeString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclaration) { + return @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation).map(new Func1<@Model.ReturnTypeJva.ClientResponseTypeString, @Model.ReturnTypeJva.GenericBodyClientTypeString>() { + @@Override + public @Model.ReturnTypeJva.GenericBodyClientTypeString call(@Model.ReturnTypeJva.ClientResponseTypeString response) { + return response.body(); + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the observable for the request + */ +public Observable<@Model.ReturnTypeJva.ClientResponseTypeString> @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterDeclaration) { +@foreach (var param in Model.RequiredNullableParameters) +{ +@: if (@param.Name == null) { +@: throw new IllegalArgumentException("Parameter @param.Name is required and cannot be null."); +@: } +} +@foreach (var param in Model.ParametersToValidate.Where(p => p.IsRequired)) +{ +@: Validator.validate(@(param.Name)); +} +@foreach (ParameterJv parameter in Model.LocalParameters) +{ + if (!parameter.IsRequired) + { +@: final @(parameter.WireType.Name) @(parameter.WireName) = @(parameter.WireType.GetDefaultValue(Model) ?? "null"); + } + if (parameter.IsConstant) + { +@: final @(parameter.ClientType.ParameterVariant.Name) @(parameter.Name) = @(parameter.DefaultValue ?? "null"); + } +} + @Model.BuildInputMappings(true) + @Model.RequiredParameterConversion + Observable> observable = service.@(Model.Name)(@Model.MethodRequiredParameterApiInvocation); + return client.getAzureClient().@(Model.PollingMethod)Async(observable, @Model.PollingResourceTypeArgs); +} + +} + +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@throws @Model.OperationExceptionTypeString thrown if the request is rejected by server + * @@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent +@if (Model.ReturnType.Body != null) +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object if successful. +} + */ +public @Model.ReturnTypeResponseName @(Model.Name)(@Model.MethodParameterDeclaration) { +@if (@Model.ReturnTypeResponseName == "void") +{ +@: @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation).toBlocking().last().body(); +} +else +{ +@: return @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation).toBlocking().last().body(); +} +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@Model.CallbackDocumentation + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the {@@link ServiceFuture} object + */ +public ServiceFuture<@Model.ReturnTypeJva.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodParameterDeclarationWithCallback) { + return ServiceFuture.@(Model.ServiceFutureFactoryMethod)(@(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation), serviceCallback); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the observable for the request + */ +public Observable<@Model.ReturnTypeJva.GenericBodyClientTypeString> @(Model.Name)Async(@Model.MethodParameterDeclaration) { + return @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation).map(new Func1<@Model.ReturnTypeJva.ClientResponseTypeString, @Model.ReturnTypeJva.GenericBodyClientTypeString>() { + @@Override + public @Model.ReturnTypeJva.GenericBodyClientTypeString call(@Model.ReturnTypeJva.ClientResponseTypeString response) { + return response.body(); + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the observable for the request + */ +public Observable<@Model.ReturnTypeJva.ClientResponseTypeString> @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterDeclaration) { +@foreach (var param in Model.RequiredNullableParameters) +{ +@: if (@param.Name == null) { +@: throw new IllegalArgumentException("Parameter @param.Name is required and cannot be null."); +@: } +} +@foreach (var param in Model.ParametersToValidate) +{ +@: Validator.validate(@(param.Name)); +} +@foreach (ParameterJv parameter in Model.LocalParameters) +{ + if (parameter.IsConstant) + { +@: final @(parameter.ModelType.Name) @(parameter.Name) = @(parameter.DefaultValue ?? "null"); + } +} + @Model.BuildInputMappings() + @Model.ParameterConversion + Observable> observable = service.@(Model.Name)(@Model.MethodParameterApiInvocation); + return client.getAzureClient().@(Model.PollingMethod)Async(observable, @Model.PollingResourceTypeArgs); +} + +} \ No newline at end of file diff --git a/src/azure/Templates/AzureServiceClientInterfaceTemplate.cshtml b/src/azure/Templates/AzureServiceClientInterfaceTemplate.cshtml new file mode 100644 index 0000000000..fafa77d9ba --- /dev/null +++ b/src/azure/Templates/AzureServiceClientInterfaceTemplate.cshtml @@ -0,0 +1,87 @@ +@using System +@using AutoRest.Java.azure.Templates +@using AutoRest.Java.vanilla.Templates +@using System.Linq +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()); +@EmptyLine +@foreach (var importClass in Model.InterfaceImports) +{ +@:import @importClass; +} +@EmptyLine + +/** + * The interface for @Model.Name class. + */ +public interface @Model.Name { + /** + * Gets the REST client. + * + * @@return the {@@link RestClient} object. + */ + RestClient restClient(); +@EmptyLine + /** + * Gets the {@@link AzureClient} used for long running operations. + * @@return the azure client; + */ + AzureClient getAzureClient(); +@EmptyLine + /** + * Gets the User-Agent header for the client. + * + * @@return the user agent string. + */ + String userAgent(); +@foreach (var property in Model.PropertiesEx) +{ +@EmptyLine +@: /** +@: * Gets @(property.Documentation). +@: * +@: * @@return the @(property.Name) value. +@: */ +@: @property.ModelType.ServiceResponseVariant().Name @(property.Name.ToCamelCase())(); +if(!property.IsReadOnly) +{ +@EmptyLine +@: /** +@: * Sets @(property.Documentation). +@: * +@: * @@param @(property.Name.ToCamelCase()) the @(property.Name) value. +@: * @@return the service client itself +@: */ +@: @(Model.Name) with@(property.Name.ToPascalCase())(@(property.ModelType.ServiceResponseVariant().Name) @(property.Name.ToCamelCase())); +} +} + +@foreach (var operation in Model.AllOperations) +{ +@EmptyLine +@: /** +@: * Gets the @(operation.TypeName) object to access its operations. +@: * @@return the @(operation.TypeName) object. +@: */ +@: @(operation.TypeName) @(operation.Name.ToCamelCase())(); +} +@EmptyLine +@if (Model.RootMethods.Any()) +{ + + @foreach (MethodJv method in Model.RootMethods) + { + @:@Include(new MethodInterfaceTemplate(), method) + @EmptyLine + } + +} +} \ No newline at end of file diff --git a/src/azure/Templates/AzureServiceClientRetrofitTemplate.cshtml b/src/azure/Templates/AzureServiceClientRetrofitTemplate.cshtml new file mode 100644 index 0000000000..284f4eaaff --- /dev/null +++ b/src/azure/Templates/AzureServiceClientRetrofitTemplate.cshtml @@ -0,0 +1,40 @@ +@using System.Linq; +@using AutoRest.Core.Model +@using AutoRest.Core.Utilities +@using AutoRest.Java.Azure.Model +@inherits AutoRest.Core.Template +/** + * The interface defining all the services for @Model.Name to be + * used by Retrofit to perform actually REST calls. + */ +interface @Model.ServiceClientServiceType { +@foreach (MethodJva method in Model.RootMethods) +{ +if (method.RequestContentType == "multipart/form-data" || method.RequestContentType == "application/x-www-form-urlencoded") +{ +@: @@Multipart +} +else +{ +@: @@Headers({ "Content-Type: @method.RequestContentType", "x-ms-logging-context: @Model.FullyQualifiedDomainName @method.Name" }) +} +if (method.HttpMethod == HttpMethod.Delete) +{ +@: @@HTTP(path = "@(method.Url.TrimStart('/'))", method = "DELETE", hasBody = true) +} +else if (method.IsPagingNextOperation) +{ +@: @@GET +} +else +{ +@: @@@(method.HttpMethod.ToString().ToUpper())("@(method.Url.TrimStart('/'))") +} +if (method.ReturnType.Body.IsPrimaryType(KnownPrimaryType.Stream)) +{ +@: @@Streaming +} +@: Observable> @(method.Name)(@method.MethodParameterApiDeclaration); +@EmptyLine +} +} \ No newline at end of file diff --git a/src/azure/Templates/AzureServiceClientTemplate.cshtml b/src/azure/Templates/AzureServiceClientTemplate.cshtml new file mode 100644 index 0000000000..76ac539f65 --- /dev/null +++ b/src/azure/Templates/AzureServiceClientTemplate.cshtml @@ -0,0 +1,223 @@ +@using System +@using AutoRest.Java.azure.Templates +@using AutoRest.Java.vanilla.Templates +@using System.Linq +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Azure.Model +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()).@(Model.ImplPackage); + +@EmptyLine +@foreach (var importClass in Model.ImplImports) +{ +@:import @importClass; +} +@EmptyLine + +/** + * Initializes a new instance of the @(Model.Name)Impl class. + */ +public class @(Model.Name)Impl@(Model.ParentDeclaration) { +@if (Model.RootMethods.Any()) +{ +@: /** The Retrofit service to perform REST calls. */ +@: private @Model.ServiceClientServiceType service; +} + /** the {@@link AzureClient} used for long running operations. */ + private AzureClient azureClient; +@EmptyLine + /** + * Gets the {@@link AzureClient} used for long running operations. + * @@return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } +@foreach (var property in Model.PropertiesEx) +{ +@EmptyLine +@: /** @(property.Documentation.ToString().Period()) */ +@: private @(property.ModelType.ServiceResponseVariant().Name) @(property.Name.ToCamelCase()); +@EmptyLine +@: /** +@: * Gets @(property.Documentation.ToString().Period()) +@: * +@: * @@return the @(property.Name) value. +@: */ +@: public @(property.ModelType.ServiceResponseVariant().Name) @(property.Name.ToCamelCase())() { +@: return this.@(property.Name.ToCamelCase()); +@: } +if(!property.IsReadOnly) +{ +@EmptyLine +@: /** +@: * Sets @(property.Documentation.ToString().Period()) +@: * +@: * @@param @(property.Name.ToCamelCase()) the @(property.Name) value. +@: * @@return the service client itself +@: */ +@: public @(Model.Name)Impl with@(property.Name.ToPascalCase())(@(property.ModelType.ServiceResponseVariant().Name) @(property.Name.ToCamelCase())) { +@: this.@(property.Name.ToCamelCase()) = @(property.Name.ToCamelCase()); +@: return this; +@: } +} +} + +@foreach (var operation in Model.AllOperations) +{ +@EmptyLine +@: /** +@: * The @(operation.MethodGroupDeclarationType) object to access its operations. +@: */ +@: private @(operation.MethodGroupDeclarationType) @(operation.Name); +@EmptyLine +@: /** +@: * Gets the @(operation.MethodGroupDeclarationType) object to access its operations. +@: * @@return the @(operation.MethodGroupDeclarationType) object. +@: */ +@: public @(operation.MethodGroupDeclarationType) @(operation.Name)() { +@: return this.@(operation.Name); +@: } +} +@EmptyLine + +@if (Settings.AddCredentials) +{ + + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param credentials the management credentials for Azure + */ + public @(Model.Name)Impl(ServiceClientCredentials credentials) { + this("@Model.BaseUrl", credentials); + } +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param baseUrl the base URL of the host + * @@param credentials the management credentials for Azure + */ + @(Model.IsCustomBaseUri ? "private" : "public") @(Model.Name)Impl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param restClient the REST client to connect to Azure. + */ + public @(Model.Name)Impl(RestClient restClient) { + super(restClient); + initialize(); + } + +@EmptyLine + + +} +else +{ + + /** + * Initializes an instance of @(Model.Name) client. + */ + public @(Model.Name)Impl() { + this("@Model.BaseUrl"); + } +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param baseUrl the base URL of the host + */ + @(Model.IsCustomBaseUri ? "private" : "public") @(Model.Name)Impl(String baseUrl) { + this(baseUrl, null); + } +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param restClient the REST client to connect to Azure + */ + public @(Model.Name)Impl(RestClient restClient) { + super(restClient); + restClient.baseUrl("@Model.BaseUrl"); + initialize(); + } +@EmptyLine + +} + protected void initialize() { +@foreach (var property in Model.PropertiesEx.Where(p => p.DefaultValue != null)) +{ + @:this.@(property.Name) = @(property.DefaultValue); +} +@foreach (MethodGroupJva operation in Model.AllOperations) +{ +@: this.@(operation.Name) = new @(operation.MethodGroupImplType)(restClient().retrofit(), this); +} + @Model.SetDefaultHeaders + this.azureClient = new AzureClient(this); +@if (Model.RootMethods.Any()) +{ +@: initializeService(); +} + } +@EmptyLine + + /** + * Gets the User-Agent header for the client. + * + * @@return the user agent string. + */ + @@Override + public String userAgent() { +@if (Model.ApiVersion == null) +{ +@: return String.format("%s (%s)", super.userAgent(), "@Model.Name"); +} +else +{ +@: return String.format("%s (%s, %s)", super.userAgent(), "@Model.Name", "@Model.ApiVersion"); +} + } +@if (Model.RootMethods.Any()) +{ +@EmptyLine + + private void initializeService() { + service = restClient().retrofit().create(@(Model.ServiceClientServiceType).class); + } + +@EmptyLine +if (Model.RootMethods.Any()) +{ +@: @Include(new AzureServiceClientRetrofitTemplate(), Model) +@EmptyLine +} + +@foreach (MethodJva method in Model.RootMethods) +{ + if (method.IsPagingOperation || method.IsPagingNextOperation) + { + @:@(Include(new PagingMethodTemplate(), method)) + } + else + { + @:@(Include(new AzureMethodTemplate(), method)) + } + @EmptyLine +} + +} +} diff --git a/src/azure/Templates/PageTemplate.cshtml b/src/azure/Templates/PageTemplate.cshtml new file mode 100644 index 0000000000..8906f9d470 --- /dev/null +++ b/src/azure/Templates/PageTemplate.cshtml @@ -0,0 +1,77 @@ +@using System.Linq +@using AutoRest.Java +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()).@(Model.ModelsPackage); +@EmptyLine +@foreach (var importClass in Model.ImportList) +{ +@:import @importClass; +} +@EmptyLine + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @@param type of Azure resource + */ +public class @Model.TypeDefinitionName implements Page { + /** + * The link to the next page. + */ + @@JsonProperty("@Model.NextLinkName") + private String nextPageLink; + @EmptyLine + /** + * The list of items. + */ + @@JsonProperty("@Model.ItemName") + private List items; + @EmptyLine + /** + * Gets the link to the next page. + * + * @@return the link to the next page. + */ + @@Override + public String nextPageLink() { + return this.nextPageLink; + } + @EmptyLine + /** + * Gets the list of items. + * + * @@return the list of items in {@@link List}. + */ + @@Override + public List items() { + return items; + } + @EmptyLine + /** + * Sets the link to the next page. + * + * @@param nextPageLink the link to the next page. + * @@return this Page object itself. + */ + public @Model.TypeDefinitionName setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + @EmptyLine + /** + * Sets the list of items. + * + * @@param items the list of items in {@@link List}. + * @@return this Page object itself. + */ + public @Model.TypeDefinitionName setItems(List items) { + this.items = items; + return this; + } +} diff --git a/src/azure/Templates/PagingMethodTemplate.cshtml b/src/azure/Templates/PagingMethodTemplate.cshtml new file mode 100644 index 0000000000..07f62c1bbc --- /dev/null +++ b/src/azure/Templates/PagingMethodTemplate.cshtml @@ -0,0 +1,460 @@ +@using System.Linq; +@using AutoRest.Core.Model +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Model +@using AutoRest.Java.Azure.Model +@inherits AutoRest.Core.Template +@if (Model.LocalParameters.Any(p => !p.IsConstant && !p.IsRequired)) +{ + +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@throws @Model.OperationExceptionTypeString thrown if the request is rejected by server + * @@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent +@if (Model.ReturnType.Body != null) +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object if successful. +} + */ +public @Model.ReturnTypeResponseName @(Model.Name)(@Model.MethodRequiredParameterDeclaration) { + @Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped response = @(Model.Name)SinglePageAsync(@Model.MethodRequiredParameterInvocation).toBlocking().single(); + return new @(Model.ReturnTypeJva.GenericBodyClientTypeString)(response.body()) { + @@Override + public @Model.ReturnTypeJva.ServiceResponseGenericParameterString nextPage(String @Model.PagingNextPageLinkParameterName) { + @Model.PagingGroupedParameterTransformation(true) + return @(Model.GetPagingNextMethodInvocation(true))(@Model.NextMethodParameterInvocation(true)).toBlocking().single().body(); + } + }; +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@Model.CallbackDocumentation + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the {@@link ServiceFuture} object + */ +public ServiceFuture<@Model.ReturnTypeJva.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclarationWithCallback) { + return AzureServiceFuture.@(Model.ServiceFutureFactoryMethod)( + @(Model.Name)SinglePageAsync(@Model.MethodRequiredParameterInvocation), + new Func1>() { + @@Override + public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> call(String @Model.PagingNextPageLinkParameterName) { + @Model.PagingGroupedParameterTransformation(true) + return @(Model.GetPagingNextMethodInvocation(true))(@Model.NextMethodParameterInvocation(true)); + } + }, + serviceCallback); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeResponseName.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJva.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclaration) { + return @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation) + .map(new Func1<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped, @Model.ReturnTypeJva.ServiceResponseGenericParameterString>() { + @@Override + public @Model.ReturnTypeJva.ServiceResponseGenericParameterString call(@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped response) { + return response.body(); + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeResponseName.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJva.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterDeclaration) { + return @(Model.Name)SinglePageAsync(@Model.MethodRequiredParameterInvocation) + .concatMap(new Func1<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped, Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped>>() { + @@Override + public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> call(@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped page) { + String @Model.PagingNextPageLinkParameterName = page.body().nextPageLink(); + if (@Model.PagingNextPageLinkParameterName == null) { + return Observable.just(page); + } + @Model.PagingGroupedParameterTransformation(true) + return Observable.just(page).concatWith(@(Model.GetPagingNextMethodInvocation(true, false))(@Model.NextMethodParameterInvocation(true))); + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object wrapped in {@@link @Model.ReturnTypeJva.ClientResponseType} if successful. +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJva.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> @(Model.Name)SinglePageAsync(@Model.MethodRequiredParameterDeclaration) { + @foreach (var param in Model.RequiredNullableParameters) +{ +@: if (@param.Name == null) { +@: throw new IllegalArgumentException("Parameter @param.Name is required and cannot be null."); +@: } +} +@foreach (var param in Model.ParametersToValidate.Where(p => p.IsRequired)) +{ +@: Validator.validate(@(param.Name)); +} +@foreach (ParameterJv parameter in Model.LocalParameters) +{ + if (!parameter.IsRequired) + { +@: final @(parameter.ClientType.Name) @(parameter.Name) = @(parameter.ClientType.GetDefaultValue(Model) ?? "null"); + } + if (parameter.IsConstant) + { +@: final @(parameter.ClientType.ParameterVariant.Name) @(parameter.Name) = @(parameter.DefaultValue ?? "null"); + + } +} + @Model.BuildInputMappings(true) + +@if (Model.IsParameterizedHost) +{ +@: String parameterizedHost = Joiner.on(", ").join(@Model.HostParameterReplacementArgs); +} + @Model.ParameterConversion +@if (Model.IsPagingNextOperation) +{ +@: String nextUrl = @(Model.NextUrlConstruction); +} + return service.@(Model.Name)(@Model.MethodRequiredParameterApiInvocation) + .flatMap(new Func1, Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped>>() { + @@Override + public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> call(Response<@Model.CallType> response) { + try { + @Model.ReturnTypeJva.GenericBodyWireTypeStringWrapped result = @(Model.Name)Delegate(response); + return Observable.just(@(Model.ReturnTypeJva.ServiceResponseCreation(Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped, "result.body()", "result"))); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); +} +@EmptyLine + +} +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@throws @Model.OperationExceptionTypeString thrown if the request is rejected by server + * @@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent +@if (Model.ReturnType.Body != null) +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object if successful. +} + */ +public @Model.ReturnTypeResponseName @(Model.Name)(@Model.MethodParameterDeclaration) { + @Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped response = @(Model.Name)SinglePageAsync(@Model.MethodParameterInvocation).toBlocking().single(); + return new @(Model.ReturnTypeJva.GenericBodyClientTypeString)(response.body()) { + @@Override + public @Model.ReturnTypeJva.ServiceResponseGenericParameterString nextPage(String @Model.PagingNextPageLinkParameterName) { + @Model.PagingGroupedParameterTransformation() + return @(Model.GetPagingNextMethodInvocation(true))(@Model.NextMethodParameterInvocation()).toBlocking().single().body(); + } + }; +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@Model.CallbackDocumentation + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the {@@link ServiceFuture} object + */ +public ServiceFuture<@Model.ReturnTypeJva.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodParameterDeclarationWithCallback) { + return AzureServiceFuture.@(Model.ServiceFutureFactoryMethod)( + @(Model.Name)SinglePageAsync(@Model.MethodParameterInvocation), + new Func1>() { + @@Override + public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> call(String @Model.PagingNextPageLinkParameterName) { + @Model.PagingGroupedParameterTransformation() + return @(Model.GetPagingNextMethodInvocation(true))(@Model.NextMethodParameterInvocation()); + } + }, + serviceCallback); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeResponseName.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJva.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterString> @(Model.Name)Async(@Model.MethodParameterDeclaration) { + return @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation) + .map(new Func1<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped, @Model.ReturnTypeJva.ServiceResponseGenericParameterString>() { + @@Override + public @Model.ReturnTypeJva.ServiceResponseGenericParameterString call(@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped response) { + return response.body(); + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeResponseName.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJva.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterDeclaration) { + return @(Model.Name)SinglePageAsync(@Model.MethodParameterInvocation) + .concatMap(new Func1<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped, Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped>>() { + @@Override + public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> call(@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped page) { + String @Model.PagingNextPageLinkParameterName = page.body().nextPageLink(); + if (@Model.PagingNextPageLinkParameterName == null) { + return Observable.just(page); + } + @Model.PagingGroupedParameterTransformation() + return Observable.just(page).concatWith(@(Model.GetPagingNextMethodInvocation(true, false))(@Model.NextMethodParameterInvocation())); + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ + @Model.ReturnTypeJva.GenericBodyWireTypeStringWrapped +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object wrapped in {@@link @Model.ReturnTypeJva.ClientResponseType} if successful. +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJva.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> @(Model.Name)SinglePageAsync(@Model.MethodParameterDeclaration) { + @foreach (var param in Model.RequiredNullableParameters) +{ +@: if (@param.Name == null) { +@: throw new IllegalArgumentException("Parameter @param.Name is required and cannot be null."); +@: } +} +@foreach (var param in Model.ParametersToValidate) +{ +@: Validator.validate(@(param.Name)); +} +@foreach (ParameterJv parameter in Model.LocalParameters) +{ + if (parameter.IsConstant) + { +@: final @(parameter.ModelType.Name) @(parameter.Name) = @(parameter.DefaultValue ?? "null"); + } +} + @Model.BuildInputMappings() + +@if (Model.IsParameterizedHost) +{ +@: String parameterizedHost = Joiner.on(", ").join(@Model.HostParameterReplacementArgs); +} + @Model.ParameterConversion +@if (Model.IsPagingNextOperation) +{ +@: String nextUrl = @(Model.NextUrlConstruction); +} + return service.@(Model.Name)(@Model.MethodParameterApiInvocation) + .flatMap(new Func1, Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped>>() { + @@Override + public Observable<@Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped> call(Response<@Model.CallType> response) { + try { + @Model.ReturnTypeJva.GenericBodyWireTypeStringWrapped result = @(Model.Name)Delegate(response); + return Observable.just(@(Model.ReturnTypeJva.ServiceResponseCreation(Model.ReturnTypeJva.ServiceResponseGenericParameterStringWrapped, "result.body()", "result"))); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); +} +@EmptyLine +private @Model.ReturnTypeJva.WireResponseTypeString @(Model.Name)Delegate(Response<@Model.CallType> response) throws @Model.ExceptionString { + return @(Model.ClientReference).restClient().responseBuilderFactory().<@Model.ReturnTypeJva.GenericBodyWireTypeString, @Model.OperationExceptionTypeString>newInstance(@(Model.ClientReference).serializerAdapter()) +@foreach (var response in Model.Responses) +{ + + @:.register(@((int)response.Key), new TypeToken<@((response.Value as ResponseJva).GenericBodyWireTypeString)>() { }.getType()) +} +@if (Model.DefaultResponse.Body != null) +{ + @:.registerError(@(Model.OperationExceptionTypeString).class) +} +@if (Model.HttpMethod == HttpMethod.Head) +{ + if (Model.ReturnType.Headers != null) + { + @:.buildEmptyWithHeaders(response, @(Model.ReturnType.Headers.Name).class); + } + else + { + @:.buildEmpty(response); + } +} +else +{ + if (Model.ReturnType.Headers != null) + { + @:.buildWithHeaders(response, @(Model.ReturnType.Headers.Name).class); + } + else + { + @:.build(response); + } +} +} \ No newline at end of file diff --git a/src/azure/Templates/SimulatedPageMethodTemplate.cshtml b/src/azure/Templates/SimulatedPageMethodTemplate.cshtml new file mode 100644 index 0000000000..b5c4254544 --- /dev/null +++ b/src/azure/Templates/SimulatedPageMethodTemplate.cshtml @@ -0,0 +1,347 @@ +@using System.Linq; +@using AutoRest.Core.Model +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Model +@using AutoRest.Java.Azure.Model +@inherits AutoRest.Core.Template +@if (Model.LocalParameters.Any(p => !p.IsConstant && !p.IsRequired)) +{ + +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@if (Model.ReturnType.Body != null) +{ +@: * @@return the PagedList<@Model.ReturnTypeJv.SequenceElementTypeString> object if successful. +} + */ +public PagedList<@Model.ReturnTypeJv.SequenceElementTypeString> @(Model.Name)(@Model.MethodRequiredParameterDeclaration) { + @((Model.ReturnTypeJv.BodyClientType as SequenceTypeJva).PageImplType)<@Model.ReturnTypeJv.SequenceElementTypeString> page = new @((Model.ReturnTypeJv.BodyClientType as SequenceTypeJva).PageImplType)<>(); + page.setItems(@(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList<@Model.ReturnTypeJv.SequenceElementTypeString>(page) { + @@Override + public Page<@Model.ReturnTypeJv.SequenceElementTypeString> nextPage(String nextPageLink) { + return null; + } + }; +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@Model.CallbackDocumentation + * @@return the {@@link ServiceFuture} object + */ +public ServiceFuture<@Model.ReturnTypeJv.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclarationWithCallback) { + return ServiceFuture.@(Model.ServiceFutureFactoryMethod)(@(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation), serviceCallback); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeJv.GenericBodyClientTypeString.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +public Observable> @(Model.Name)Async(@Model.MethodRequiredParameterDeclaration) { + return @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation).map(new Func1<@Model.ReturnTypeJv.ClientResponseTypeString, Page<@Model.ReturnTypeJv.SequenceElementTypeString>>() { + @@Override + public Page<@Model.ReturnTypeJv.SequenceElementTypeString> call(@Model.ReturnTypeJv.ClientResponseTypeString response) { + @Model.ReturnTypeJv.GenericBodyWireTypeString page = new @((Model.ReturnTypeJv.BodyClientType as SequenceTypeJva).PageImplType)<>(); + page.setItems(response.body()); + return page; + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeJv.GenericBodyClientTypeString.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJv.ClientResponseTypeString> @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterDeclaration) { +@foreach (var param in Model.RequiredNullableParameters) +{ +@: if (@param.Name == null) { +@: throw new IllegalArgumentException("Parameter @param.Name is required and cannot be null."); +@: } +} +@foreach (var param in Model.ParametersToValidate.Where(p => p.IsRequired)) +{ +@: Validator.validate(@(param.Name)); +} +@foreach (ParameterJv parameter in Model.LocalParameters) +{ + if (!parameter.IsRequired) + { +@: final @(parameter.ClientType.Name) @(parameter.Name) = @(parameter.ClientType.GetDefaultValue(Model) ?? "null"); + } + if (parameter.IsConstant) + { +@: final @(parameter.ClientType.Name) @(parameter.Name) = @(parameter.DefaultValue ?? "null"); + + } +} + @Model.BuildInputMappings(true) + +@if (Model.IsParameterizedHost) +{ +@: String parameterizedHost = Joiner.on(", ").join(@Model.HostParameterReplacementArgs); +} + @Model.ParameterConversion + return service.@(Model.Name)(@Model.MethodRequiredParameterApiInvocation) + .flatMap(new Func1, Observable<@(Model.ReturnTypeJv.ClientResponseTypeString)>>() { + @@Override + public Observable<@(Model.ReturnTypeJv.ClientResponseTypeString)> call(Response<@Model.CallType> response) { + try { + @Model.ClientResponse() + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); +} +@EmptyLine + +} +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@if (Model.ReturnType.Body != null) +{ +@: * @@return the PagedList<@Model.ReturnTypeJv.SequenceElementTypeString> object if successful. +} + */ +public PagedList<@Model.ReturnTypeJv.SequenceElementTypeString> @(Model.Name)(@Model.MethodParameterDeclaration) { + @((Model.ReturnTypeJv.BodyClientType as SequenceTypeJva).PageImplType)<@Model.ReturnTypeJv.SequenceElementTypeString> page = new @((Model.ReturnTypeJv.BodyClientType as SequenceTypeJva).PageImplType)<>(); + page.setItems(@(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList<@Model.ReturnTypeJv.SequenceElementTypeString>(page) { + @@Override + public Page<@Model.ReturnTypeJv.SequenceElementTypeString> nextPage(String nextPageLink) { + return null; + } + }; +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@Model.CallbackDocumentation + * @@return the {@@link ServiceFuture} object + */ +public ServiceFuture<@Model.ReturnTypeJv.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodParameterDeclarationWithCallback) { + return ServiceFuture.@(Model.ServiceFutureFactoryMethod)(@(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation), serviceCallback); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeJv.GenericBodyClientTypeString.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +public Observable> @(Model.Name)Async(@Model.MethodParameterDeclaration) { + return @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation).map(new Func1<@Model.ReturnTypeJv.ClientResponseTypeString, Page<@Model.ReturnTypeJv.SequenceElementTypeString>>() { + @@Override + public Page<@Model.ReturnTypeJv.SequenceElementTypeString> call(@Model.ReturnTypeJv.ClientResponseTypeString response) { + @Model.ReturnTypeJv.GenericBodyWireTypeString page = new @((Model.ReturnTypeJv.BodyClientType as SequenceTypeJva).PageImplType)<>(); + page.setItems(response.body()); + return page; + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeJv.GenericBodyClientTypeString.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJv.ClientResponseTypeString> @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterDeclaration) { +@foreach (var param in Model.RequiredNullableParameters) +{ +@: if (@param.Name == null) { +@: throw new IllegalArgumentException("Parameter @param.Name is required and cannot be null."); +@: } +} +@foreach (var param in Model.ParametersToValidate) +{ +@: Validator.validate(@(param.Name)); +} +@foreach (ParameterJv parameter in Model.LocalParameters) +{ + if (parameter.IsConstant) + { +@: final @(parameter.ModelType.Name) @(parameter.Name) = @(parameter.DefaultValue ?? "null"); + } +} + @Model.BuildInputMappings() + +@if (Model.IsParameterizedHost) +{ +@: String parameterizedHost = Joiner.on(", ").join(@Model.HostParameterReplacementArgs); +} + @Model.ParameterConversion + return service.@(Model.Name)(@Model.MethodParameterApiInvocation) + .flatMap(new Func1, Observable<@(Model.ReturnTypeJv.ClientResponseTypeString)>>() { + @@Override + public Observable<@(Model.ReturnTypeJv.ClientResponseTypeString)> call(Response<@Model.CallType> response) { + try { + @Model.ClientResponse() + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); +} +@EmptyLine +private @Model.ReturnTypeJv.WireResponseTypeString @(Model.Name)Delegate(Response<@Model.CallType> response) throws @Model.ExceptionString { + return @(Model.ClientReference).restClient().responseBuilderFactory().<@Model.ReturnTypeJv.GenericBodyWireTypeString, @Model.OperationExceptionTypeString>newInstance(@(Model.ClientReference).serializerAdapter()) +@foreach (var response in Model.Responses) +{ + + @:.register(@((int)response.Key), new TypeToken<@((response.Value as ResponseJv).GenericBodyWireTypeString)>() { }.getType()) +} +@if (Model.DefaultResponse.Body != null) +{ + @:.registerError(@(Model.OperationExceptionTypeString).class) +} +@if (Model.HttpMethod == HttpMethod.Head) +{ + if (Model.ReturnType.Headers != null) + { + @:.buildEmptyWithHeaders(response, @(Model.ReturnType.Headers.Name).class); + } + else + { + @:.buildEmpty(response); + } +} +else +{ + if (Model.ReturnType.Headers != null) + { + @:.buildWithHeaders(response, @(Model.ReturnType.Headers.Name).class); + } + else + { + @:.build(response); + } +} +} diff --git a/src/azure/TransformerJva.cs b/src/azure/TransformerJva.cs new file mode 100644 index 0000000000..fb427bd2a6 --- /dev/null +++ b/src/azure/TransformerJva.cs @@ -0,0 +1,296 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Newtonsoft.Json.Linq; +using AutoRest.Core; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Core.Utilities.Collections; +using AutoRest.Extensions; +using AutoRest.Extensions.Azure; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using static AutoRest.Core.Utilities.DependencyInjection; + +namespace AutoRest.Java.Azure +{ + public class TransformerJva : TransformerJv, ITransformer + { + /// + /// A type-specific method for code model tranformation. + /// Note: This is the method you want to override. + /// + /// + /// + public override CodeModelJv TransformCodeModel(CodeModel cm) + { + var codeModel = cm as CodeModelJva; + + // we're guaranteed to be in our language-specific context here. + Settings.Instance.AddCredentials = true; + + // This extension from general extensions must be run prior to Azure specific extensions. + AzureExtensions.ProcessParameterizedHost(codeModel); + AzureExtensions.ProcessClientRequestIdExtension(codeModel); + AzureExtensions.UpdateHeadMethods(codeModel); + AzureExtensions.ProcessGlobalParameters(codeModel); + AzureExtensions.FlattenModels(codeModel); + AzureExtensions.FlattenMethodParameters(codeModel); + ParameterGroupExtensionHelper.AddParameterGroups(codeModel); + AddLongRunningOperations(codeModel); + AzureExtensions.AddAzureProperties(codeModel); + AzureExtensions.SetDefaultResponses(codeModel); + + // set Parent on responses (required for pageable) + foreach (MethodJva method in codeModel.Methods) + { + foreach (ResponseJva response in method.Responses.Values) + { + response.Parent = method; + } + (method.DefaultResponse as ResponseJva).Parent = method; + method.ReturnTypeJva.Parent = method; + } + AzureExtensions.AddPageableMethod(codeModel); + + // pluralize method groups + foreach (var mg in codeModel.Operations) + { + mg.Name.OnGet += name => name.IsNullOrEmpty() || name.EndsWith("s", StringComparison.OrdinalIgnoreCase) ? name : $"{name}s"; + } + + NormalizePaginatedMethods(codeModel, codeModel.pageClasses); + + // param order (PATH first) + foreach (MethodJva method in codeModel.Methods) + { + var ps = method.Parameters.ToList(); + method.ClearParameters(); + foreach (var p in ps.Where(x => x.Location == ParameterLocation.Path)) + { + method.Add(p); + } + foreach (var p in ps.Where(x => x.Location != ParameterLocation.Path)) + { + method.Add(p); + } + } + + return codeModel; + } + + public static void AddLongRunningOperations(CodeModel codeModel) + { + if (codeModel == null) + { + throw new ArgumentNullException("codeModel"); + } + + foreach (var operation in codeModel.Operations) + { + var methods = operation.Methods.ToArray(); + operation.ClearMethods(); + foreach (var method in methods) + { + operation.Add(method); + if (true == method.Extensions.Get(AzureExtensions.LongRunningExtension)) + { + // copy the method + var m = Duplicate(method); + + // change the name, remove the extension. + m.Name = "Begin" + m.Name.ToPascalCase(); + m.Extensions.Remove(AzureExtensions.LongRunningExtension); + + operation.Add(m); + } + } + } + } + + + CodeModelJva ITransformer.TransformCodeModel(CodeModel codeModel) + { + return this.TransformCodeModel(codeModel) as CodeModelJva; + } + + /// + /// Changes paginated method signatures to return Page type. + /// + /// + /// + public void NormalizePaginatedMethods(CodeModel serviceClient, IDictionary, string> pageClasses) + { + if (serviceClient == null) + { + throw new ArgumentNullException("serviceClient"); + } + + var convertedTypes = new Dictionary(); + + foreach (MethodJva method in serviceClient.Methods.Where(m => m.Extensions.ContainsKey(AzureExtensions.PageableExtension) || (m as MethodJva).SimulateAsPagingOperation)) + { + string nextLinkString; + string pageClassName = GetPagingSetting(method.Extensions, pageClasses, method.SimulateAsPagingOperation, out nextLinkString); + if (string.IsNullOrEmpty(pageClassName)) + { + continue; + } + if (string.IsNullOrEmpty(nextLinkString)) + { + method.Extensions[AzureExtensions.PageableExtension] = null; + } + bool anyTypeConverted = false; + foreach (var responseStatus in method.Responses.Where(r => r.Value.Body is CompositeTypeJva).Select(s => s.Key).ToArray()) + { + anyTypeConverted = true; + var compositeType = (CompositeTypeJva)method.Responses[responseStatus].Body; + var sequenceType = compositeType.Properties.Select(p => p.ModelType).FirstOrDefault(t => t is SequenceTypeJva) as SequenceTypeJva; + + // if the type is a wrapper over page-able response + if (sequenceType != null) + { + IModelType pagedResult; + pagedResult = new SequenceTypeJva + { + ElementType = sequenceType.ElementType, + PageImplType = pageClassName + }; + + convertedTypes[method.Responses[responseStatus].Body] = pagedResult; + var resp = New(pagedResult, method.Responses[responseStatus].Headers) as ResponseJva; + resp.Parent = method; + method.Responses[responseStatus] = resp; + } + } + + if (!anyTypeConverted && method.SimulateAsPagingOperation) + { + foreach (var responseStatus in method.Responses.Where(r => r.Value.Body is SequenceTypeJva).Select(s => s.Key).ToArray()) + { + var sequenceType = (SequenceTypeJva)method.Responses[responseStatus].Body; + + IModelType pagedResult; + pagedResult = new SequenceTypeJva + { + ElementType = sequenceType.ElementType, + PageImplType = pageClassName + }; + + convertedTypes[method.Responses[responseStatus].Body] = pagedResult; + var resp = New(pagedResult, method.Responses[responseStatus].Headers) as ResponseJva; + resp.Parent = method; + method.Responses[responseStatus] = resp; + } + } + + if (convertedTypes.ContainsKey(method.ReturnType.Body)) + { + var resp = New(convertedTypes[method.ReturnType.Body], method.ReturnType.Headers) as ResponseJva; + resp.Parent = method; + method.ReturnType = resp; + } + } + + SwaggerExtensions.RemoveUnreferencedTypes(serviceClient, + new HashSet(convertedTypes.Keys.Where(x => x is CompositeTypeJva).Cast().Select(t => t.Name.ToString()))); + } + + public virtual void NormalizeODataMethods(CodeModel client) + { + if (client == null) + { + throw new ArgumentNullException("client"); + } + + foreach (var method in client.Methods) + { + if (method.Extensions.ContainsKey(AzureExtensions.ODataExtension)) + { + var odataFilter = method.Parameters.FirstOrDefault(p => + p.SerializedName.EqualsIgnoreCase("$filter") && + (p.Location == ParameterLocation.Query) && + p.ModelType is CompositeType); + + if (odataFilter == null) + { + continue; + } + + // Remove all odata parameters + method.Remove(source => + (source.SerializedName.EqualsIgnoreCase("$filter") || + source.SerializedName.EqualsIgnoreCase("$top") || + source.SerializedName.EqualsIgnoreCase("$orderby") || + source.SerializedName.EqualsIgnoreCase("$skip") || + source.SerializedName.EqualsIgnoreCase("$expand")) + && (source.Location == ParameterLocation.Query)); + + var odataQuery = New(new + { + SerializedName = "$filter", + Name = "odataQuery", + ModelType = New($"Microsoft.Rest.Azure.OData.ODataQuery<{odataFilter.ModelType.Name}>"), + Documentation = "OData parameters to apply to the operation.", + Location = ParameterLocation.Query, + odataFilter.IsRequired + }); + odataQuery.Extensions[AzureExtensions.ODataExtension] = + method.Extensions[AzureExtensions.ODataExtension]; + method.Insert(odataQuery); + } + } + } + + private static string GetPagingSetting(Dictionary extensions, + IDictionary, string> pageClasses, bool simulatingPaging, out string nextLinkName) + { + // default value + nextLinkName = null; + var itemName = "value"; + string className = null; + + if (extensions.ContainsKey(AzureExtensions.PageableExtension)) + { + var ext = extensions[AzureExtensions.PageableExtension] as JContainer; + + if (ext == null) + { + return null; + } + + nextLinkName = (string)ext["nextLinkName"]; + itemName = (string)ext["itemName"] ?? "value"; + className = (string)ext["className"]; + } + else if (!simulatingPaging) + { + return null; + } + + var keypair = new KeyValuePair(nextLinkName, itemName); + if (!pageClasses.ContainsKey(keypair)) + { + if (string.IsNullOrWhiteSpace(className)) + { + if (pageClasses.Count > 0) + { + className = $"PageImpl{pageClasses.Count}"; + } + else + { + className = "PageImpl"; + } + } + pageClasses.Add(keypair, className); + } + + return pageClasses[keypair]; + } + } +} diff --git a/src/azurefluent/CodeGeneratorJvaf.cs b/src/azurefluent/CodeGeneratorJvaf.cs new file mode 100644 index 0000000000..9c218afeef --- /dev/null +++ b/src/azurefluent/CodeGeneratorJvaf.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using AutoRest.Core; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Extensions; +using AutoRest.Extensions.Azure; +using AutoRest.Java.Azure.Fluent.Model; +using AutoRest.Java.azure.Templates; +using AutoRest.Java.Model; +using AutoRest.Java.vanilla.Templates; +using System; + +namespace AutoRest.Java.Azure.Fluent +{ + public class CodeGeneratorJvaf : CodeGeneratorJva + { + private const string ClientRuntimePackage = "com.microsoft.azure:azure-client-runtime:1.0.0-beta6-SNAPSHOT"; + private const string _packageInfoFileName = "package-info.java"; + + public override bool IsSingleFileGenerationSupported => true; + + public override string UsageInstructions => $"The {ClientRuntimePackage} maven dependency is required to execute the generated code."; + + /// + /// Generates C# code for service client. + /// + /// + /// + public override async Task Generate(CodeModel cm) + { + // get Azure Java specific codeModel + var codeModel = cm as CodeModelJvaf; + if (codeModel == null) + { + throw new InvalidCastException("CodeModel is not a Azure Java Fluent CodeModel"); + } + + // Service client + var serviceClientTemplate = new AzureServiceClientTemplate { Model = codeModel }; + await Write(serviceClientTemplate, $"{Path.Combine("implementation", codeModel.Name.ToPascalCase() + "Impl")}{ImplementationFileExtension}"); + + // operations + foreach (MethodGroupJvaf methodGroup in codeModel.AllOperations) + { + // Operation + var operationsTemplate = new AzureMethodGroupTemplate { Model = methodGroup }; + await Write(operationsTemplate, $"{Path.Combine("implementation", methodGroup.TypeName.ToPascalCase())}Inner{ImplementationFileExtension}"); + } + + //Models + foreach (CompositeTypeJvaf modelType in cm.ModelTypes.Concat(codeModel.HeaderTypes)) + { + if (modelType.Extensions.ContainsKey(AzureExtensions.ExternalExtension) && + (bool)modelType.Extensions[AzureExtensions.ExternalExtension]) + { + continue; + } + if (modelType.IsResource) + { + continue; + } + + var modelTemplate = new ModelTemplate { Model = modelType }; + await Write(modelTemplate, Path.Combine(modelType.ModelsPackage.Trim('.'), $"{modelType.Name.ToPascalCase()}{ImplementationFileExtension}")); + } + + //Enums + foreach (EnumTypeJvaf enumType in cm.EnumTypes) + { + var enumTemplate = new EnumTemplate { Model = enumType }; + await Write(enumTemplate, Path.Combine(enumType.ModelsPackage.Trim('.'), $"{enumTemplate.Model.Name.ToPascalCase()}{ImplementationFileExtension}")); + } + + // Page class + foreach (var pageClass in codeModel.pageClasses) + { + var pageTemplate = new PageTemplate + { + Model = new PageJvaf(pageClass.Value, pageClass.Key.Key, pageClass.Key.Value), + }; + await Write(pageTemplate, Path.Combine("implementation", $"{pageTemplate.Model.TypeDefinitionName.ToPascalCase()}{ImplementationFileExtension}")); + } + + // Exceptions + foreach (CompositeTypeJv exceptionType in codeModel.ErrorTypes) + { + if (exceptionType.Name == "CloudError") + { + continue; + } + + var exceptionTemplate = new ExceptionTemplate { Model = exceptionType }; + await Write(exceptionTemplate, Path.Combine(exceptionType.ModelsPackage.Trim('.'), $"{exceptionTemplate.Model.ExceptionTypeDefinitionName}{ImplementationFileExtension}")); + } + + // package-info.java + await Write(new PackageInfoTemplate + { + Model = new PackageInfoTemplateModel(cm) + }, _packageInfoFileName); + await Write(new PackageInfoTemplate + { + Model = new PackageInfoTemplateModel(cm, "implementation") + }, Path.Combine("implementation", _packageInfoFileName)); + } + } +} diff --git a/src/azurefluent/GlobalSuppressions.cs b/src/azurefluent/GlobalSuppressions.cs new file mode 100644 index 0000000000..31eeaabf7f --- /dev/null +++ b/src/azurefluent/GlobalSuppressions.cs @@ -0,0 +1,27 @@ +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureJavaFluentCodeGenerator.#.ctor(AutoRest.Core.Settings)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureJavaFluentCodeNamer.#NormalizeTopLevelTypes(AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentMethodGroupTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentMethodTemplateModel.#.ctor(AutoRest.Core.ClientModel.Method,AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentMethodTemplateModel.#TransformPagingGroupedParameter(AutoRest.Core.Utilities.IndentedStringBuilder,AutoRest.Java.Azure.AzureMethodTemplateModel,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentMethodTemplateModel.#InterfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentMethodTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentModelTemplateModel.#.ctor(AutoRest.Core.ClientModel.CompositeType,AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentServiceClientTemplateModel.#InterfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.AzureFluentServiceClientTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "AutoRest.Java")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.FluentCompositeTypeModel.#.ctor(System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.Azure.Fluent.FluentCompositeTypeModel.#.ctor(System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.FluentEnumTypeModel.#.ctor(AutoRest.Core.ClientModel.EnumType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.FluentEnumTypeModel.#.ctor(AutoRest.Core.ClientModel.EnumType,System.String)")] +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. +// +// To add a suppression to this file, right-click the message in the +// Code Analysis results, point to "Suppress Message", and click +// "In Suppression File". +// You do not need to add suppressions to this file manually. diff --git a/src/azurefluent/Model/CodeModelJvaf.cs b/src/azurefluent/Model/CodeModelJvaf.cs new file mode 100644 index 0000000000..ba6483b490 --- /dev/null +++ b/src/azurefluent/Model/CodeModelJvaf.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Fluent.Model +{ + public class CodeModelJvaf : CodeModelJva + { + [JsonIgnore] + public override string ImplPackage + { + get + { + return "implementation"; + } + } + + [JsonIgnore] + public override string ParentDeclaration + { + get + { + return " extends AzureServiceClient"; + } + } + + [JsonIgnore] + public override List InterfaceImports + { + get + { + var imports = base.InterfaceImports; + imports.Add("com.microsoft.azure.AzureClient"); + return imports.OrderBy(i => i).ToList(); + } + } + + [JsonIgnore] + public override IEnumerable ImplImports + { + get + { + var imports = new List(); + var ns = Namespace.ToLowerInvariant(); + foreach (var i in base.ImplImports.ToList()) + { + if (i.StartsWith(ns + "." + ImplPackage, StringComparison.OrdinalIgnoreCase)) + { + // Same package, do nothing + } + else if (Operations.Any(m => i.EndsWith(m.TypeName, StringComparison.OrdinalIgnoreCase))) + { + // do nothing + } + else if (i.EndsWith(this.Name, StringComparison.OrdinalIgnoreCase)) + { + // do nothing + } + else + { + imports.Add(i); + } + } + return imports.OrderBy(i => i).ToList(); + } + } + } +} \ No newline at end of file diff --git a/src/azurefluent/Model/CompositeTypeJvaf.cs b/src/azurefluent/Model/CompositeTypeJvaf.cs new file mode 100644 index 0000000000..d8122f4610 --- /dev/null +++ b/src/azurefluent/Model/CompositeTypeJvaf.cs @@ -0,0 +1,97 @@ +using System; +using System.Globalization; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Azure.Model; +using System.Collections.Generic; +using System.Linq; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Fluent.Model +{ + public class CompositeTypeJvaf : CompositeTypeJva + { + public CompositeTypeJvaf() + { + Name.OnGet += nam => nam.IsNullOrEmpty() || !IsInnerModel ? nam : nam + "Inner"; + } + + public CompositeTypeJvaf(string name) : base(name) + { + Name.OnGet += nam => nam.IsNullOrEmpty() || !IsInnerModel ? nam : nam + "Inner"; + } + + public override IEnumerableWithIndex Properties + { + get + { + var res = base.Properties; + res.OfType().ForEach(p => p.IsInnerModel = IsInnerModel); + return res; + } + } + + [JsonIgnore] + public override string Package + { + get + { + if (this.IsResource) + { + return _azureRuntimePackage; + } + else if (Extensions.ContainsKey(ExternalExtension) && + (bool)Extensions[ExternalExtension]) + { + return _runtimePackage; + } + else if (Name.ToString().EndsWith("Inner", StringComparison.Ordinal)) + { + return (CodeModel?.Namespace.ToLowerInvariant()) + ".implementation"; + } + else + { + return (CodeModel?.Namespace.ToLowerInvariant()); + } + } + } + + + [JsonIgnore] + public override string ModelsPackage => IsInnerModel ? ".implementation" : ""; + + public bool IsInnerModel { get; set; } = false; + + [JsonIgnore] + public override IEnumerable Imports + { + get + { + var imports = new List(); + if (Name.Contains('<')) + { + imports.AddRange(ParseGenericType().SelectMany(t => t.Imports)); + } + else + { + imports.Add(string.Join(".", Package, Name)); + } + return imports; + } + } + + [JsonIgnore] + public override IEnumerable ImportList + { + get + { + List imports = base.ImportList.ToList(); + if (BaseModelType != null && BaseModelType.Name.ToString().EndsWith("Inner", StringComparison.Ordinal) ^ IsInnerModel) + { + imports.AddRange(BaseModelType.ImportSafe()); + } + return imports.Distinct(); + } + } + } +} diff --git a/src/azurefluent/Model/EnumTypeJvaf.cs b/src/azurefluent/Model/EnumTypeJvaf.cs new file mode 100644 index 0000000000..249658d76b --- /dev/null +++ b/src/azurefluent/Model/EnumTypeJvaf.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using System.Globalization; +using AutoRest.Java.Azure.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Fluent.Model +{ + public class EnumTypeJvaf : EnumTypeJva + { + [JsonIgnore] + public override IEnumerable Imports + { + get + { + if (Name != "String") + { + yield return string.Join(".", + (CodeModel?.Namespace.ToLowerInvariant()) + (Name.ToString().EndsWith("Inner") ? ".implementation" : ""), + Name); + } + } + } + + [JsonIgnore] + public override string ModelsPackage + { + get + { + return ""; + } + } + } +} diff --git a/src/azurefluent/Model/MethodGroupJvaf.cs b/src/azurefluent/Model/MethodGroupJvaf.cs new file mode 100644 index 0000000000..de9e8fc697 --- /dev/null +++ b/src/azurefluent/Model/MethodGroupJvaf.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using AutoRest.Core.Model; +using AutoRest.Java.Azure.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Fluent.Model +{ + public class MethodGroupJvaf : MethodGroupJva + { + private List supportedInterfaces = new List(); + private List interfacesToImport = new List(); + + public MethodGroupJvaf() + { + } + public MethodGroupJvaf(string name) : base(name) + { + } + + [JsonIgnore] + public override string MethodGroupDeclarationType => MethodGroupImplType; + + [JsonIgnore] + public override string ImplClassSuffix => "Inner"; + + [JsonIgnore] + public override string ParentDeclaration + { + get + { + DiscoverAllSupportedInterfaces(); + + if (supportedInterfaces.Count() > 0) + { + return $" implements {string.Join(", ", supportedInterfaces)}"; + } + + return ""; + } + } + + [JsonIgnore] + public override string ServiceClientType => CodeModel.Name + "Impl"; + + [JsonIgnore] + public override string ImplPackage => "implementation"; + + [JsonIgnore] + public override IEnumerable ImplImports + { + get + { + DiscoverAllSupportedInterfaces(); + var imports = new List(); + var ns = CodeModel.Namespace.ToLowerInvariant(); + foreach (var interfaceToImport in interfacesToImport) + { + imports.Add(interfaceToImport); + } + foreach (var i in base.ImplImports.ToList()) + { + if (i.StartsWith(ns + "." + ImplPackage, StringComparison.OrdinalIgnoreCase)) + { + // Same package, do nothing + } + else if (i == ns + "." + this.TypeName) + { + // do nothing + } + else + { + imports.Add(i); + } + } + return imports; + } + } + + private bool AnyMethodSupportsInnerListing() + { + var listMethod = this.Methods.FirstOrDefault(x => StringComparer.OrdinalIgnoreCase.Equals(x.Name, WellKnowMethodNames.List)); + var listByResourceGroup = this.Methods.FirstOrDefault(x => StringComparer.OrdinalIgnoreCase.Equals(x.Name, WellKnowMethodNames.ListByResourceGroup)); + return listMethod != null && listByResourceGroup != null + && StringComparer.OrdinalIgnoreCase.Equals( + ((ResponseJva)listMethod.ReturnType).SequenceElementTypeString, + ((ResponseJva)listByResourceGroup.ReturnType).SequenceElementTypeString); + } + + private void DiscoverAllSupportedInterfaces() + { + const string InnerSupportsGet = "InnerSupportsGet"; + const string InnerSupportsDelete = "InnerSupportsDelete"; + const string InnerSupportsListing = "InnerSupportsListing"; + + // In case this method has already discovered the interfaces to be implemented, we don't need to do anything again. + if (supportedInterfaces.Count() > 0) + { + return; + } + + const string packageName = "com.microsoft.azure.management.resources.fluentcore.collection"; + var getMethod = this.Methods.FirstOrDefault(x => StringComparer.OrdinalIgnoreCase.Equals(x.Name, WellKnowMethodNames.GetByResourceGroup)); + if (getMethod != null && Take2RequiredParameters(getMethod)) + { + supportedInterfaces.Add($"{InnerSupportsGet}<{((ResponseJva)getMethod.ReturnType).GenericBodyClientTypeString}>"); + interfacesToImport.Add($"{packageName}.{InnerSupportsGet}"); + } + + var deleteMethod = this.Methods.FirstOrDefault(x => StringComparer.OrdinalIgnoreCase.Equals(x.Name, WellKnowMethodNames.Delete)); + if (deleteMethod != null && Take2RequiredParameters(deleteMethod)) + { + supportedInterfaces.Add($"{InnerSupportsDelete}<{((ResponseJva)deleteMethod.ReturnType).ClientCallbackTypeString}>"); + interfacesToImport.Add($"{packageName}.{InnerSupportsDelete}"); + } + + if (AnyMethodSupportsInnerListing()) + { + // Getting list method to get the name of the type to be supported. + var listMethod = this.Methods.FirstOrDefault(x => StringComparer.OrdinalIgnoreCase.Equals(x.Name, WellKnowMethodNames.List)); + + supportedInterfaces.Add($"{InnerSupportsListing}<{((ResponseJva)listMethod.ReturnType).SequenceElementTypeString}>"); + interfacesToImport.Add($"{packageName}.{InnerSupportsListing}"); + } + } + + private static bool Take2RequiredParameters(Method method) + { + // When parameters are optional we generate more methods. + return method.Parameters.Count(x => !x.IsClientProperty && !x.IsConstant && x.IsRequired) == 2; + } + } +} \ No newline at end of file diff --git a/src/azurefluent/Model/MethodJvaf.cs b/src/azurefluent/Model/MethodJvaf.cs new file mode 100644 index 0000000000..db6ea8d569 --- /dev/null +++ b/src/azurefluent/Model/MethodJvaf.cs @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Linq; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using AutoRest.Core; +using Newtonsoft.Json; +using System; +using AutoRest.Core.Utilities.Collections; +using System.Text.RegularExpressions; + +namespace AutoRest.Java.Azure.Fluent.Model +{ + public class MethodJvaf : MethodJva + { + public override void Disambiguate() + { + if (string.IsNullOrWhiteSpace(this.MethodGroup.Name)) + { + base.Disambiguate(); + + return; + } + + var methodType = GetMethodType(this); + var originalName = Name; + + if (methodType != MethodType.Other) + { + string newName = null; + + if (this.MethodGroup.Methods.Count(x => GetMethodType(x as MethodJvaf) == methodType) == 1) + { + switch (methodType) + { + case MethodType.ListBySubscription: + newName = WellKnowMethodNames.List; + break; + + case MethodType.ListByResourceGroup: + newName = WellKnowMethodNames.ListByResourceGroup; + break; + + case MethodType.Delete: + newName = WellKnowMethodNames.Delete; + break; + + case MethodType.Get: + newName = WellKnowMethodNames.GetByResourceGroup; + break; + + default: + throw new Exception("Flow should not hit this statement."); + } + } + if (!string.IsNullOrWhiteSpace(newName)) + { + if (methodType == MethodType.ListByResourceGroup || methodType == MethodType.ListBySubscription) + { + this.SimulateAsPagingOperation = true; + } + + var name = CodeNamer.Instance.GetUnique(newName, this, Parent.IdentifiersInScope, Parent.Children.Except(this.SingleItemAsEnumerable())); + if (name != originalName) + { + Name = name; + } + return; + } + } + + base.Disambiguate(); + } + + [JsonIgnore] + public override IEnumerable RetrofitParameters + { + get + { + List parameters = base.RetrofitParameters.ToList(); + + parameters.First(p => p.SerializedName == "User-Agent") + .ClientProperty = new PropertyJvaf + { + Name = "userAgent" + }; + return parameters; + } + } + + protected override void TransformPagingGroupedParameter(IndentedStringBuilder builder, MethodJva nextMethod, bool filterRequired = false) + { + if (this.InputParameterTransformation.IsNullOrEmpty() || nextMethod.InputParameterTransformation.IsNullOrEmpty()) + { + return; + } + var groupedType = this.InputParameterTransformation.First().ParameterMappings[0].InputParameter; + var nextGroupType = nextMethod.InputParameterTransformation.First().ParameterMappings[0].InputParameter; + if (nextGroupType.Name == groupedType.Name) + { + return; + } + var nextGroupTypeName = CodeNamer.Instance.GetTypeName(nextGroupType.Name) + "Inner"; + if (filterRequired && !groupedType.IsRequired) + { + return; + } + if (!groupedType.IsRequired) + { + builder.AppendLine("{0} {1} = null;", nextGroupTypeName, nextGroupType.Name.ToCamelCase()); + builder.AppendLine("if ({0} != null) {{", groupedType.Name.ToCamelCase()); + builder.Indent(); + builder.AppendLine("{0} = new {1}();", nextGroupType.Name.ToCamelCase(), nextGroupTypeName); + } + else + { + builder.AppendLine("{1} {0} = new {1}();", nextGroupType.Name.ToCamelCase(), nextGroupTypeName); + } + foreach (var outParam in nextMethod.InputParameterTransformation.Select(t => t.OutputParameter)) + { + builder.AppendLine("{0}.with{1}({2}.{3}());", nextGroupType.Name.ToCamelCase(), outParam.Name.ToPascalCase(), groupedType.Name.ToCamelCase(), outParam.Name.ToCamelCase()); + } + if (!groupedType.IsRequired) + { + builder.Outdent().AppendLine(@"}"); + } + } + + [JsonIgnore] + public override List InterfaceImports + { + get + { + var imports = base.InterfaceImports; + if (this.IsPagingOperation || this.IsPagingNextOperation || this.SimulateAsPagingOperation) + { + imports.Add("com.microsoft.azure.PagedList"); + + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + imports.Add("com.microsoft.azure.ListOperationCallback"); + } + + if (!this.SimulateAsPagingOperation) + { + imports.Remove("com.microsoft.rest.ServiceCallback"); + } + + var pageType = ReturnTypeJva.BodyClientType as SequenceTypeJva; + if (pageType != null) + { + imports.AddRange(new CompositeTypeJvaf(pageType.PageImplType).ImportSafe()); + } + } + return imports; + } + } + + [JsonIgnore] + public override List ImplImports + { + get + { + var pageType = ReturnTypeJva.BodyClientType as SequenceTypeJva; + + var imports = base.ImplImports; + if (OperationExceptionTypeString != "CloudException" && OperationExceptionTypeString != "RestException") + { + imports.RemoveAll(i => new CompositeTypeJva(OperationExceptionTypeString) { CodeModel = CodeModel }.ImportSafe().Contains(i)); + imports.AddRange(new CompositeTypeJvaf(OperationExceptionTypeString) { CodeModel = CodeModel }.ImportSafe()); + } + if (this.IsLongRunningOperation) + { + imports.Remove("com.microsoft.azure.AzureResponseBuilder"); + this.Responses.Select(r => r.Value.Body).Concat(new IModelType[]{ DefaultResponse.Body }) + .SelectMany(t => t.ImportSafe()) + .Where(i => !this.Parameters.Any(p => p.ModelType.ImportSafe().Contains(i))) + .ForEach(i => imports.Remove(i)); + // return type may have been removed as a side effect + imports.AddRange(this.ReturnTypeJva.ImplImports); + } + imports = imports.Distinct().ToList(); + if (this.IsPagingOperation || this.IsPagingNextOperation || SimulateAsPagingOperation) + { + imports.Add("com.microsoft.azure.PagedList"); + + if (this.IsPagingOperation || this.IsPagingNextOperation) + { + imports.Add("com.microsoft.azure.ListOperationCallback"); + } + + if (!this.SimulateAsPagingOperation) + { + imports.Remove("com.microsoft.rest.ServiceCallback"); + } + + imports.Remove("java.util.ArrayList"); + imports.Add("com.microsoft.azure.Page"); + if (pageType != null) + { + imports.RemoveAll(i => new CompositeTypeJva((ReturnTypeJva.BodyClientType as SequenceTypeJva).PageImplType) { CodeModel = CodeModel }.ImportSafe().Contains(i)); + } + } + + if (this.IsPagingNonPollingOperation && pageType != null) + { + imports.RemoveAll(i => new CompositeTypeJva((ReturnTypeJva.BodyClientType as SequenceTypeJva).PageImplType) { CodeModel = CodeModel }.ImportSafe().Contains(i)); + } + return imports; + } + } + + private enum MethodType + { + Other, + ListBySubscription, + ListByResourceGroup, + Get, + Delete + } + + private static MethodType GetMethodType(MethodJvaf method) + { + Regex leading = new Regex("^/+"); + Regex trailing = new Regex("/+$"); + var methodUrl = trailing.Replace(leading.Replace(method.Url, ""), ""); + if (method.HttpMethod == HttpMethod.Get) + { + var urlSplits = methodUrl.Split('/'); + if ((urlSplits.Count() == 5 || urlSplits.Count() == 7) + && StringComparer.OrdinalIgnoreCase.Equals(urlSplits[0], "subscriptions") + && method.ReturnType.Body is SequenceType) + { + if (urlSplits.Count() == 5) + { + if (StringComparer.OrdinalIgnoreCase.Equals(urlSplits[2], "providers")) + { + return MethodType.ListBySubscription; + } + else + { + return MethodType.ListByResourceGroup; + } + } + else if (StringComparer.OrdinalIgnoreCase.Equals(urlSplits[2], "resourceGroups")) + { + return MethodType.ListByResourceGroup; + } + } + if (IsTopLevelResourceUrl(methodUrl)) + { + return MethodType.Get; + } + } + else if (method.HttpMethod == HttpMethod.Delete) + { + if (method.Name.Value.ToLowerInvariant().StartsWith("begin") + || method.MethodGroup.Methods.Count(x => x.HttpMethod == HttpMethod.Delete) > 1) + { + return MethodType.Other; + } + + if (IsTopLevelResourceUrl(methodUrl)) + { + return MethodType.Delete; + } + } + + return MethodType.Other; + } + + private static bool IsTopLevelResourceUrl(string url) + { + var urlSplits = url.Split('/'); + + return urlSplits.Count() == 8 && StringComparer.OrdinalIgnoreCase.Equals(urlSplits[0], "subscriptions") + && StringComparer.OrdinalIgnoreCase.Equals(urlSplits[2], "resourceGroups") + && StringComparer.OrdinalIgnoreCase.Equals(urlSplits[4], "providers"); + } + } +} \ No newline at end of file diff --git a/src/azurefluent/Model/PageJvaf.cs b/src/azurefluent/Model/PageJvaf.cs new file mode 100644 index 0000000000..f35bfe7ee4 --- /dev/null +++ b/src/azurefluent/Model/PageJvaf.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using AutoRest.Java.Azure.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Fluent.Model +{ + public class PageJvaf : PageJva + { + public PageJvaf(string typeDefinitionName, string nextLinkName, string itemName) + : base(typeDefinitionName, nextLinkName, itemName) { + } + + [JsonIgnore] + public override string ModelsPackage + { + get + { + return "implementation"; + } + } + } +} diff --git a/src/azurefluent/Model/PropertyJvaf.cs b/src/azurefluent/Model/PropertyJvaf.cs new file mode 100644 index 0000000000..cfb5910755 --- /dev/null +++ b/src/azurefluent/Model/PropertyJvaf.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Azure.Fluent.Model +{ + public class PropertyJvaf : PropertyJv + { + public bool IsInnerModel { get; set; } = false; + + [JsonIgnore] + public override IEnumerable Imports + { + get + { + var imports = new List(ModelType.ImportSafe() + .Where(c => !c.StartsWith(Parent.CodeModel?.Namespace.ToLowerInvariant(), StringComparison.Ordinal) || + c.EndsWith("Inner", StringComparison.Ordinal) ^ IsInnerModel)); + if (ModelType.IsPrimaryType(KnownPrimaryType.DateTimeRfc1123)) + { + imports.AddRange(ModelType.ImportSafe()); + imports.AddRange((ModelType as IModelTypeJv).ResponseVariant.ImportSafe()); + } + return imports; + } + } + } +} diff --git a/src/azurefluent/PluginJvaf.cs b/src/azurefluent/PluginJvaf.cs new file mode 100644 index 0000000000..5545581468 --- /dev/null +++ b/src/azurefluent/PluginJvaf.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using AutoRest.Core; +using AutoRest.Core.Extensibility; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Azure.Fluent; +using AutoRest.Java.Azure.Fluent.Model; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using static AutoRest.Core.Utilities.DependencyInjection; + +namespace AutoRest.Java.Azure +{ + public sealed class PluginJvaf : Plugin + { + public PluginJvaf() + { + Context = new Context + { + // inherit base settings + Context, + + // set code model implementations our own implementations + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory() + }; + } + } +} \ No newline at end of file diff --git a/src/azurefluent/TransformerJvaf.cs b/src/azurefluent/TransformerJvaf.cs new file mode 100644 index 0000000000..9ad154596b --- /dev/null +++ b/src/azurefluent/TransformerJvaf.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using Newtonsoft.Json.Linq; +using AutoRest.Core; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Core.Utilities.Collections; +using AutoRest.Extensions; +using AutoRest.Extensions.Azure; +using AutoRest.Java.Azure.Model; +using AutoRest.Java.Model; +using static AutoRest.Core.Utilities.DependencyInjection; +using AutoRest.Java.Azure.Fluent.Model; + +namespace AutoRest.Java.Azure +{ + public class TransformerJvaf : TransformerJva, ITransformer + { + public override CodeModelJv TransformCodeModel(CodeModel cm) + { + var codeModel = cm as CodeModelJva; + + // we're guaranteed to be in our language-specific context here. + Settings.Instance.AddCredentials = true; + + // This extension from general extensions must be run prior to Azure specific extensions. + AzureExtensions.ProcessParameterizedHost(codeModel); + AzureExtensions.ProcessClientRequestIdExtension(codeModel); + AzureExtensions.UpdateHeadMethods(codeModel); + AzureExtensions.ProcessGlobalParameters(codeModel); + AzureExtensions.FlattenModels(codeModel); + AzureExtensions.FlattenMethodParameters(codeModel); + ParameterGroupExtensionHelper.AddParameterGroups(codeModel); + AddLongRunningOperations(codeModel); + AzureExtensions.AddAzureProperties(codeModel); + AzureExtensions.SetDefaultResponses(codeModel); + + // set Parent on responses (required for pageable) + foreach (MethodJva method in codeModel.Methods) + { + foreach (ResponseJva response in method.Responses.Values) + { + response.Parent = method; + } + (method.DefaultResponse as ResponseJva).Parent = method; + method.ReturnTypeJva.Parent = method; + } + AzureExtensions.AddPageableMethod(codeModel); + + // pluralize method groups + foreach (var mg in codeModel.Operations) + { + mg.Name.OnGet += name => name.IsNullOrEmpty() || name.EndsWith("s", StringComparison.OrdinalIgnoreCase) ? $"{name}" : $"{name}s"; + } + + NormalizePaginatedMethods(codeModel, codeModel.pageClasses); + + // determine inner models + NormalizeTopLevelTypes(codeModel); + + // param order (PATH first) + foreach (MethodJva method in codeModel.Methods) + { + var ps = method.Parameters.ToList(); + method.ClearParameters(); + foreach (var p in ps.Where(x => x.Location == ParameterLocation.Path)) + { + method.Add(p); + } + foreach (var p in ps.Where(x => x.Location != ParameterLocation.Path)) + { + method.Add(p); + } + } + + return codeModel; + } + + CodeModelJvaf ITransformer.TransformCodeModel(CodeModel cm) + { + return TransformCodeModel(cm) as CodeModelJvaf; + } + + public void NormalizeTopLevelTypes(CodeModel serviceClient) + { + foreach (var param in serviceClient.Methods.SelectMany(m => m.Parameters)) + { + AppendInnerToTopLevelType(param.ModelType, serviceClient); + } + foreach (var response in serviceClient.Methods.SelectMany(m => m.Responses).Select(r => r.Value)) + { + AppendInnerToTopLevelType(response.Body, serviceClient); + AppendInnerToTopLevelType(response.Headers, serviceClient); + } + foreach (var model in serviceClient.ModelTypes) + { + if (model.BaseModelType != null && (model.BaseModelType.Name == "Resource" || model.BaseModelType.Name == "SubResource")) + AppendInnerToTopLevelType(model, serviceClient); + } + } + + private void AppendInnerToTopLevelType(IModelType type, CodeModel serviceClient) + { + if (type == null) + { + return; + } + CompositeTypeJvaf compositeType = type as CompositeTypeJvaf; + SequenceType sequenceType = type as SequenceType; + DictionaryType dictionaryType = type as DictionaryType; + if (compositeType != null && !compositeType.IsResource) + { + compositeType.IsInnerModel = true; + } + else if (sequenceType != null) + { + AppendInnerToTopLevelType(sequenceType.ElementType, serviceClient); + } + else if (dictionaryType != null) + { + AppendInnerToTopLevelType(dictionaryType.ValueType, serviceClient); + } + } + } +} diff --git a/src/azurefluent/WellKnowMethodNames.cs b/src/azurefluent/WellKnowMethodNames.cs new file mode 100644 index 0000000000..ecd9138396 --- /dev/null +++ b/src/azurefluent/WellKnowMethodNames.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace AutoRest.Java.Azure.Fluent +{ + class WellKnowMethodNames + { + public const string GetByResourceGroup = "GetByResourceGroup"; + public const string ListByResourceGroup = "ListByResourceGroup"; + public const string List = "List"; + public const string Delete = "Delete"; + + } +} diff --git a/src/vanilla/ClientModelExtensions.cs b/src/vanilla/ClientModelExtensions.cs new file mode 100644 index 0000000000..d33c71ca40 --- /dev/null +++ b/src/vanilla/ClientModelExtensions.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text; +using AutoRest.Core.Model; +using AutoRest.Java.Model; + +namespace AutoRest.Java +{ + public static class ClientModelExtensions + { + public const string ExternalExtension = "x-ms-external"; + + public static string Period(this string documentation) + { + if (string.IsNullOrEmpty(documentation)) + { + return documentation; + } + documentation = documentation.Trim(); + if (!documentation.EndsWith(".", StringComparison.Ordinal)) + { + documentation += "."; + } + return documentation; + } + + public static string TrimMultilineHeader(this string header) + { + if (string.IsNullOrEmpty(header)) + { + return header; + } + StringBuilder builder = new StringBuilder(); + foreach (var headerLine in header.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) + { + builder.Append(headerLine.TrimEnd()).Append(Environment.NewLine); + } + return builder.ToString(); + } + + public static string GetJsonProperty(this Property property) + { + if (property == null) + { + return null; + } + + List settings = new List(); + settings.Add(string.Format(CultureInfo.InvariantCulture, "value = \"{0}\"", property.SerializedName)); + if (property.IsRequired) + { + settings.Add("required = true"); + } + if (property.IsReadOnly) + { + settings.Add("access = JsonProperty.Access.WRITE_ONLY"); + } + return string.Join(", ", settings); + } + + public static void AddRange(this HashSet hashSet, IEnumerable range) + { + if( hashSet == null || range == null) + { + return; + } + + foreach(var item in range) + { + hashSet.Add(item); + } + } + + /// + /// A null friendly wrapper around type imports. + /// + /// an instance of IJavaType + /// a list of imports to append + public static IEnumerable ImportSafe(this IModelType type) + { + if (type == null) + { + return new List(); + } + return ((IModelTypeJv) type).Imports; + } + + public static string ImportFrom(this HttpMethod httpMethod) + { + string package = "retrofit2.http."; + if (httpMethod == HttpMethod.Delete) + { + return package + "HTTP"; + } + else + { + return package + httpMethod.ToString().ToUpperInvariant(); + } + } + } +} diff --git a/src/vanilla/CodeGeneratorJv.cs b/src/vanilla/CodeGeneratorJv.cs new file mode 100644 index 0000000000..4dd1f76843 --- /dev/null +++ b/src/vanilla/CodeGeneratorJv.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using AutoRest.Core; +using AutoRest.Core.Utilities; +using AutoRest.Extensions; +using AutoRest.Java.vanilla.Templates; +using AutoRest.Java.Model; +using AutoRest.Core.Model; +using System; + +namespace AutoRest.Java +{ + public class CodeGeneratorJv : CodeGenerator + { + private const string ClientRuntimePackage = "com.microsoft.rest:client-runtime:1.0.0-beta6-SNAPSHOT from snapshot repo https://oss.sonatype.org/content/repositories/snapshots/"; + private const string _packageInfoFileName = "package-info.java"; + + public CodeNamerJv Namer { get; private set; } + + public override string UsageInstructions => $"The {ClientRuntimePackage} maven dependency is required to execute the generated code."; + + public override string ImplementationFileExtension => ".java"; + + /// + /// Generate Java client code for given ServiceClient. + /// + /// + /// + public override async Task Generate(CodeModel cm) + { + // get Java specific codeModel + var codeModel = cm as CodeModelJv; + if (codeModel == null) + { + throw new InvalidCastException("CodeModel is not a Java CodeModel"); + } + + // Service client + var serviceClientTemplate = new ServiceClientTemplate { Model = codeModel }; + await Write(serviceClientTemplate, $"{Path.Combine("implementation", cm.Name.ToPascalCase() + "Impl")}{ImplementationFileExtension}"); + + // Service client interface + var serviceClientInterfaceTemplate = new ServiceClientInterfaceTemplate { Model = codeModel }; + await Write(serviceClientInterfaceTemplate, $"{cm.Name.ToPascalCase()}{ImplementationFileExtension}"); + + // operations + foreach (MethodGroupJv methodGroup in codeModel.AllOperations) + { + // Operation + var operationsTemplate = new MethodGroupTemplate { Model = methodGroup }; + await Write(operationsTemplate, $"{Path.Combine("implementation", methodGroup.TypeName.ToPascalCase())}Impl{ImplementationFileExtension}"); + + // Operation interface + var operationsInterfaceTemplate = new MethodGroupInterfaceTemplate { Model = methodGroup }; + await Write(operationsInterfaceTemplate, $"{methodGroup.TypeName.ToPascalCase()}{ImplementationFileExtension}"); + } + + //Models + foreach (CompositeTypeJv modelType in cm.ModelTypes.Union(codeModel.HeaderTypes)) + { + var modelTemplate = new ModelTemplate { Model = modelType }; + await Write(modelTemplate, Path.Combine("models", $"{modelType.Name.ToPascalCase()}{ImplementationFileExtension}")); + } + + // Enums + foreach (EnumTypeJv enumType in cm.EnumTypes) + { + var enumTemplate = new EnumTemplate { Model = enumType }; + await Write(enumTemplate, Path.Combine("models", $"{enumTemplate.Model.Name.ToPascalCase()}{ImplementationFileExtension}")); + } + + // Exceptions + foreach (CompositeTypeJv exceptionType in codeModel.ErrorTypes) + { + var exceptionTemplate = new ExceptionTemplate { Model = exceptionType }; + await Write(exceptionTemplate, Path.Combine("models", $"{exceptionTemplate.Model.ExceptionTypeDefinitionName.ToPascalCase()}{ImplementationFileExtension}")); + } + + // package-info.java + await Write(new PackageInfoTemplate + { + Model = new PackageInfoTemplateModel(cm) + }, _packageInfoFileName); + await Write(new PackageInfoTemplate + { + Model = new PackageInfoTemplateModel(cm, "implementation") + }, Path.Combine("implementation", _packageInfoFileName)); + await Write(new PackageInfoTemplate + { + Model = new PackageInfoTemplateModel(cm, "models") + }, Path.Combine("models", _packageInfoFileName)); + } + } +} diff --git a/src/vanilla/CodeNamerJv.cs b/src/vanilla/CodeNamerJv.cs new file mode 100644 index 0000000000..8f6b6c2778 --- /dev/null +++ b/src/vanilla/CodeNamerJv.cs @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text.RegularExpressions; +using AutoRest.Core; +using AutoRest.Core.Utilities; +using AutoRest.Extensions; +using AutoRest.Core.Model; +using AutoRest.Java.Model; + +namespace AutoRest.Java +{ + public class CodeNamerJv : CodeNamer + { + private Dictionary _visited = new Dictionary(); + + public static HashSet PrimaryTypes { get; private set; } + + #region constructor + + /// + /// Initializes a new instance of CSharpCodeNamingFramework. + /// + public CodeNamerJv() + { + // List retrieved from + // http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html + ReservedWords.AddRange(new [] + { + "abstract", "assert", "boolean", "break", "byte", + "case", "catch", "char", "class", "const", + "continue", "default", "do", "double", "else", + "enum", "extends", "false", "final", "finally", + "float", "for", "goto", "if", "implements", + "import", "int", "long", "interface","instanceof", + "native", "new", "null", "package", "private", + "protected","public", "return", "short", "static", + "strictfp", "super", "switch", "synchronized","this", + "throw", "throws", "transient","true", "try", + "void", "volatile", "while", "date", "datetime", + "period", "stream", "string", "object", "header" + }); + + PrimaryTypes = new HashSet(); + new HashSet + { + "int", "Integer", + "long", "Long", + "object", "Object", + "bool", "Boolean", + "double", "Double", + "float", "Float", + "byte", "Byte", + "byte[]", "Byte[]", + "String", + "LocalDate", + "DateTime", + "DateTimeRfc1123", + "Duration", + "Period", + "BigDecimal", + "InputStream" + }.ForEach(s => PrimaryTypes.Add(s)); + new HashSet + { + "int", + "long", + "bool", + "double", + "float", + "byte", + "byte[]" + }.ForEach(s => PrimaryTypes.Add(s)); + } + + #endregion + + #region naming + + public override string GetFieldName(string name) + { + if (string.IsNullOrWhiteSpace(name)) + { + return name; + } + return '_' + GetVariableName(name); + } + + public override string GetPropertyName(string name) + { + if (string.IsNullOrWhiteSpace(name)) + { + return name; + } + return CamelCase(RemoveInvalidCharacters(GetEscapedReservedName(name, "Property"))); + } + + public override string GetMethodName(string name) + { + name = GetEscapedReservedName(name, "Method"); + return CamelCase(name); + } + + public override string GetMethodGroupName(string name) + { + if (string.IsNullOrWhiteSpace(name)) + { + return name; + } + name = PascalCase(name); + if (!name.EndsWith("s", StringComparison.OrdinalIgnoreCase)) + { + name += "s"; + } + return name; + } + + public override string GetEnumMemberName(string name) + { + if (string.IsNullOrWhiteSpace(name)) + { + return name; + } + string result = RemoveInvalidCharacters(new Regex("[\\ -]+").Replace(name, "_")); + Func isUpper = new Func(c => c >= 'A' && c <= 'Z'); + Func isLower = new Func(c => c >= 'a' && c <= 'z'); + for (int i = 1; i < result.Length - 1; i++) + { + if (isUpper(result[i])) + { + if (result[i - 1] != '_' && isLower(result[i - 1])) + { + result = result.Insert(i, "_"); + } + } + } + return result.ToUpperInvariant(); + } + + public override string GetParameterName(string name) + { + return base.GetParameterName(GetEscapedReservedName(name, "Parameter")); + } + + public override string GetVariableName(string name) + { + return base.GetVariableName(GetEscapedReservedName(name, "Variable")); + } + + public static string GetServiceName(string name) + { + if (string.IsNullOrWhiteSpace(name)) + { + return name; + } + return name + "Service"; + } + + #endregion + + #region type handling + + public static string GetJavaException(string exception, CodeModel cm) + { + switch (exception) { + case "IOException": + return "java.io.IOException"; + case "CloudException": + return "com.microsoft.azure.CloudException"; + case "RestException": + return "com.microsoft.rest.RestException"; + case "IllegalArgumentException": + return null; + case "InterruptedException": + return null; + default: + return (cm.Namespace.ToLowerInvariant()) + + ".models." + exception; + } + } + + #endregion + + public override string EscapeDefaultValue(string defaultValue, IModelType type) + { + if (type == null) + { + throw new ArgumentNullException("type"); + } + + var primaryType = type as PrimaryType; + if (defaultValue != null && primaryType != null) + { + if (primaryType.KnownPrimaryType == KnownPrimaryType.Double) + { + return double.Parse(defaultValue).ToString(); + } + if (primaryType.KnownPrimaryType == KnownPrimaryType.String) + { + return QuoteValue(defaultValue); + } + else if (primaryType.KnownPrimaryType == KnownPrimaryType.Boolean) + { + return defaultValue.ToLowerInvariant(); + } + else if (primaryType.KnownPrimaryType == KnownPrimaryType.Long) + { + return defaultValue + "L"; + } + else + { + if (primaryType.KnownPrimaryType == KnownPrimaryType.Date) + { + return "LocalDate.parse(\"" + defaultValue + "\")"; + } + else if (primaryType.KnownPrimaryType == KnownPrimaryType.DateTime || + primaryType.KnownPrimaryType == KnownPrimaryType.DateTimeRfc1123) + { + return "DateTime.parse(\"" + defaultValue + "\")"; + } + else if (primaryType.KnownPrimaryType == KnownPrimaryType.TimeSpan) + { + return "Period.parse(\"" + defaultValue + "\")"; + } + else if (primaryType.KnownPrimaryType == KnownPrimaryType.ByteArray) + { + return "\"" + defaultValue + "\".getBytes()"; + } + } + } + return defaultValue; + } + } +} \ No newline at end of file diff --git a/src/vanilla/GlobalSuppressions.cs b/src/vanilla/GlobalSuppressions.cs new file mode 100644 index 0000000000..28705d884d --- /dev/null +++ b/src/vanilla/GlobalSuppressions.cs @@ -0,0 +1,195 @@ +// This file is used by Code Analysis to maintain SuppressMessage +// attributes that are applied to this project. +// Project-level suppressions either have no target or are given +// a specific target and scoped to a namespace, type, member, etc. +// +// To add a suppression to this file, right-click the message in the +// Code Analysis results, point to "Suppress Message", and click +// "In Suppression File". +// You do not need to add suppressions to this file manually. + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", + Target = "AutoRest.Java.ServiceClientTemplateModel.#ModelTemplateModels", Justification="Using another type would add unneeded complexity")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", + Target = "AutoRest.Java.MethodGroupTemplateModel.#MethodTemplateModels", Justification="Using another type would add unneeded complexity")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", + Target = "AutoRest.Java.MethodTemplateModel.#ParameterTemplateModels", Justification="Using another type would add unneeded complexity")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", + Target = "AutoRest.Java.ServiceClientTemplateModel.#MethodTemplateModels", Justification="Using another type would add unneeded complexity")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", + Scope = "namespace", Target = "AutoRest.Java.TemplateModels", Justification = "Parallel with other generators")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", + Scope = "member", + Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.String)", Justification="Code simplification")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", + Scope = "member", + Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#DeserializeType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.String)", Justification="Code simplification")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", + Scope = "member", + Target = "AutoRest.Java.MethodTemplateModel.#GetDeserializationString(AutoRest.Core.ClientModel.IType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", + MessageId = "0#", Scope = "member", + Target = "AutoRest.Java.MethodTemplateModel.#RemoveDuplicateForwardSlashes(System.String)", Justification="Uri will not pass uri validation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1055:UriReturnValuesShouldNotBeStrings", + Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#BuildUrl(System.String)", Justification="Uri will not pass uri validation")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", + MessageId = "1", Scope = "member", + Target = "AutoRest.Java.MethodTemplateModel.#.ctor(AutoRest.Core.ClientModel.Method,AutoRest.Core.ClientModel.ServiceClient)", Justification="Validated by LoadFrom method")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", + MessageId = "0", Scope = "member", + Target = "AutoRest.Java.MethodTemplateModel.#.ctor(AutoRest.Core.ClientModel.Method,AutoRest.Core.ClientModel.ServiceClient)", Justification="Validated by LoadFrom method")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", + MessageId = "0", Scope = "member", + Target = "AutoRest.Java.ModelTemplateModel.#.ctor(AutoRest.Core.ClientModel.CompositeType,AutoRest.Core.ClientModel.ServiceClient)", Justification="Validated by LoadFrom method")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", + "CA1303:Do not pass literals as localized parameters", + MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", + Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#DeserializeType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.String)", Justification="Literal string is generated code, no localization concerns")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", + "CA1303:Do not pass literals as localized parameters", + MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", + Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateRequiredType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.String)", Justification="Literal string is generated code, no localization concerns")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", + "CA1303:Do not pass literals as localized parameters", + MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", + Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.String)", Justification="Literal string is generated code, no localization concerns")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", + "CA1303:Do not pass literals as localized parameters", + MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", + Target = "AutoRest.Java.MethodTemplateModel.#GetDeserializationString(AutoRest.Core.ClientModel.IType,System.String)", Justification="Literal string is generated code, no localization concerns")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", + "CA1303:Do not pass literals as localized parameters", + MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", + Target = "AutoRest.Java.ServiceClientTemplateModel.#PolymorphicDictionary", Justification="Literal string is generated code, no localization concerns")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", + "CA1303:Do not pass literals as localized parameters", + MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", + Target = "AutoRest.Java.MethodTemplateModel.#BuildUrl(System.String)", Justification="Literal string is generated code, no localization concerns")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", + "CA1303:Do not pass literals as localized parameters", + MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", + Target = "AutoRest.Java.MethodTemplateModel.#RemoveDuplicateForwardSlashes(System.String)", Justification="Literal string is generated code, no localization concerns")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.Append(System.String)", Scope = "member", Target = "AutoRest.Java.ServiceClientTemplateModel.#PolymorphicDictionary", Justification="Literal string is generated code, no localization concerns")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", + Scope = "member", + Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.String)", Justification="Node conventions require lower casing")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", + Scope = "member", + Target = "AutoRest.Java.ModelTemplateModel.#isSpecial(AutoRest.Core.ClientModel.IType)", Justification="False Positive")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", + MessageId = "gi", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#RemoveDuplicateForwardSlashes(System.String)", Justification="Generated code parameters to regular expression")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#AddQueryParametersToUrl(System.String,AutoRest.Core.Utilities.IndentedStringBuilder)", Justification="Literal string is generated code, no localization concerns.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#BuildQueryParameterArray(AutoRest.Core.Utilities.IndentedStringBuilder)", Justification="Literal string is generated code, no localization concerns.")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "QueryParameters", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#HasQueryParameters()", Justification="False Positive")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", MessageId = "ms-rest", Scope = "resource", Target = "AutoRest.Java.Properties.Resources.resources", Justification="ms-rest is a valid npm package name")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.Append(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "isArray", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "util", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateType(AutoRest.Core.ClientModel.IType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ConstructValidationCheck(System.String,System.String,System.String,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ConstructValidationCheck(System.String,System.String,System.String,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "instanceof", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "valueOf", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "typeof", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateDictionaryType(AutoRest.Core.ClientModel.DictionaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateDictionaryType(AutoRest.Core.ClientModel.DictionaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateSequenceType(AutoRest.Core.ClientModel.SequenceType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateSequenceType(AutoRest.Core.ClientModel.SequenceType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.Append(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateCompositeType(AutoRest.Core.ClientModel.CompositeType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateCompositeType(AutoRest.Core.ClientModel.CompositeType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.Append(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateEnumType(AutoRest.Core.ClientModel.EnumType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateEnumType(AutoRest.Core.ClientModel.EnumType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "isNaN", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "isNaN", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "valueOf", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "typeof", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "instanceof", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidatePrimaryType(AutoRest.Core.ClientModel.PrimaryType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateEnumType(AutoRest.Core.ClientModel.EnumType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.Append(System.String)", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ValidateEnumType(AutoRest.Core.ClientModel.EnumType,AutoRest.Core.Utilities.IScopeProvider,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.MethodGroupTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.MethodGroupTemplateModel.#InterfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.ServiceClientTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.ServiceClientTemplateModel.#InterfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.MethodGroupTemplateModel.#TypeImports(System.Collections.Generic.IList`1)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#TypeImports(System.Collections.Generic.IList`1,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Scope = "member", Target = "AutoRest.Java.MethodGroupTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ImportFrom(AutoRest.Core.ClientModel.IType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ImportFrom(AutoRest.Core.ClientModel.IType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ImportFrom(AutoRest.Core.ClientModel.Parameter,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#InterfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ImplImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.ServiceClientTemplateModel.#InterfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ImportFrom(AutoRest.Core.ClientModel.Parameter)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ExceptionStatements")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.PackageInfoTemplateModel.#.ctor(AutoRest.Core.ClientModel.ServiceClient,System.String,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#GetJavaException(System.String,AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#GetJavaException(System.String,AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#QuoteString(System.String,AutoRest.Core.ClientModel.IType)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#EscapeDefaultValue(System.String,AutoRest.Core.ClientModel.IType)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#BuildInputMappings()")] + +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.TemplateModels.ClientModelExtensions.#ImportFrom(AutoRest.Core.ClientModel.IType,System.String,AutoRest.Java.JavaCodeNamer)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#ImportType(AutoRest.Core.ClientModel.IType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#ImportType(AutoRest.Core.ClientModel.IType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getBody", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getDateTime", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "DateTime", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getBody", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getDateTime", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#SuccessCallback")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "DateTime", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ResponseGeneration")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "AutoRest.Java.ResponseModel.#converToClientType(AutoRest.Core.ClientModel.IType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.CompositeTypeModel.#_package")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.CompositeTypeModel.#_runtimePackage")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.CompositeTypeModel.#.ctor(System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.CompositeTypeModel.#.ctor(System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.EnumTypeModel.#.ctor(AutoRest.Core.ClientModel.EnumType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.EnumTypeModel.#.ctor(AutoRest.Core.ClientModel.EnumType,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Imports", Scope = "member", Target = "AutoRest.Java.IModelTypeJv.#Imports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.JavaCodeGenerator.#.ctor(AutoRest.Core.Settings)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#_package")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#.ctor(System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#.ctor(System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#NormalizeTypeReference(AutoRest.Core.ClientModel.IType)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#NormalizeCompositeType(AutoRest.Core.ClientModel.CompositeType)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ParameterModels")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#LogicalParameterModels")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.ModelTemplateModel.#.ctor(AutoRest.Core.ClientModel.CompositeType,AutoRest.Core.ClientModel.ServiceClient)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "AutoRest.Java.ParameterModel.#LocationImport(AutoRest.Core.ClientModel.ParameterLocation)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "AutoRest.Java.ParameterModel.#NeedsSpecialSerialization(AutoRest.Core.ClientModel.IType)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.ResponseModel.#_response")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.ModelTemplateModel.#PropertyModels")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "1", Scope = "member", Target = "AutoRest.Java.PropertyModel.#.ctor(AutoRest.Core.ClientModel.Property,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.PropertyModel.#.ctor(AutoRest.Core.ClientModel.Property,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "AutoRest.Java.ParameterModel.#convertClientTypeToWireType(AutoRest.Java.IModelTypeJv,System.String,System.String,System.String,System.Int32)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.Append(System.String)", Scope = "member", Target = "AutoRest.Java.ParameterModel.#convertClientTypeToWireType(AutoRest.Java.IModelTypeJv,System.String,System.String,System.String,System.Int32)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.ResponseModel.#_interfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.ResponseModel.#_interfaceImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1002:DoNotExposeGenericLists", Scope = "member", Target = "AutoRest.Java.ResponseModel.#_implImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.ResponseModel.#_implImports")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.Append(System.String)", Scope = "member", Target = "AutoRest.Java.ResponseModel.#convertToClientType(AutoRest.Java.IModelTypeJv,System.String,System.String,System.Int32)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#BuildInputMappings(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#BuildInputMappings(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ResponseGeneration(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getBody", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ResponseGeneration(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#ResponseGeneration(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "getBody", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#SuccessCallback(System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters", MessageId = "AutoRest.Core.Utilities.IndentedStringBuilder.AppendLine(System.String)", Scope = "member", Target = "AutoRest.Java.ParameterModel.#convertClientTypeToWireType(AutoRest.Java.IModelTypeJv,System.String,System.String,System.String,System.Int32)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1062:Validate arguments of public methods", MessageId = "0", Scope = "member", Target = "AutoRest.Java.PrimaryTypeModel.#DefaultValue(AutoRest.Core.ClientModel.Method)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.MethodGroupTemplateModel.#MethodGroupTypeString")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase", Scope = "member", Target = "AutoRest.Java.MethodGroupTemplateModel.#MethodGroupFullType")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1026:DefaultParametersShouldNotBeUsed", Scope = "member", Target = "AutoRest.Java.PackageInfoTemplateModel.#.ctor(AutoRest.Core.ClientModel.ServiceClient,System.String,System.String)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily", Scope = "member", Target = "AutoRest.Java.JavaCodeNamer.#NormalizeTypeDeclaration(AutoRest.Core.ClientModel.IType)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "AutoRest.Java.MethodTemplateModel.#GetMapping(AutoRest.Core.ClientModel.ParameterMapping,System.Boolean)")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Scope = "member", Target = "AutoRest.Java.ModelTemplateModel.#PropertyModels")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields", Scope = "member", Target = "AutoRest.Java.PropertyModel.#_package")] +[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Imports", Scope = "member", Target = "AutoRest.Java.PropertyModel.#Imports")] + diff --git a/src/vanilla/IScopeProvider.cs b/src/vanilla/IScopeProvider.cs new file mode 100644 index 0000000000..70c4e5cf58 --- /dev/null +++ b/src/vanilla/IScopeProvider.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +namespace AutoRest.Java +{ + public interface IScopeProvider + { + string GetVariableName(string prefix); + } +} \ No newline at end of file diff --git a/src/vanilla/Model/CodeModelJv.cs b/src/vanilla/Model/CodeModelJv.cs new file mode 100644 index 0000000000..0139a73e4d --- /dev/null +++ b/src/vanilla/Model/CodeModelJv.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using AutoRest.Core.Utilities; +using AutoRest.Extensions; +using AutoRest.Core.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class CodeModelJv : CodeModel + { + public override string BaseUrl + { + get + { + if (!base.BaseUrl.Contains("://")) + { + return $"https://{base.BaseUrl}"; + } + return base.BaseUrl; + } + set + { + base.BaseUrl = value; + } + } + + [JsonIgnore] + public IEnumerable AllOperations => Operations.Where(operation => !operation.Name.IsNullOrEmpty()).Cast(); + + [JsonIgnore] + public bool IsCustomBaseUri => Extensions.ContainsKey(SwaggerExtensions.ParameterizedHostExtension); + + [JsonIgnore] + public string ServiceClientServiceType + { + get + { + return CodeNamerJv.GetServiceName(Name.ToPascalCase()); + } + } + + [JsonIgnore] + public virtual string ImplPackage => "implementation"; + + [JsonIgnore] + public string ModelsPackage => ".models"; + + [JsonIgnore] + public IEnumerable RootMethods => Methods.Where(m => m.Group.IsNullOrEmpty()).OfType(); + + [JsonIgnore] + public string FullyQualifiedDomainName => Namespace.ToLowerInvariant() + "." + this.Name; + + [JsonIgnore] + public virtual IEnumerable ImplImports + { + get + { + HashSet classes = new HashSet(); + classes.Add(FullyQualifiedDomainName); + foreach(var methodGroupFullType in this.AllOperations.Select(op => op.MethodGroupFullType).Distinct()) + { + classes.Add(methodGroupFullType); + } + if (this.Properties.Any(p => p.ModelType.IsPrimaryType(KnownPrimaryType.Credentials))) + { + classes.Add("com.microsoft.rest.credentials.ServiceClientCredentials"); + } + classes.AddRange(new[]{ + "com.microsoft.rest.ServiceClient", + "com.microsoft.rest.RestClient", + "okhttp3.OkHttpClient", + "retrofit2.Retrofit" + }); + + classes.AddRange(RootMethods + .SelectMany(m => m.ImplImports) + .OrderBy(i => i)); + + return classes.AsEnumerable(); + } + } + + [JsonIgnore] + public virtual List InterfaceImports + { + get + { + HashSet classes = new HashSet(); + + classes.AddRange(RootMethods + .SelectMany(m => m.InterfaceImports) + .OrderBy(i => i).Distinct()); + + classes.Add("com.microsoft.rest.RestClient"); + + return classes.ToList(); + } + } + } +} \ No newline at end of file diff --git a/src/vanilla/Model/CompositeTypeJv.cs b/src/vanilla/Model/CompositeTypeJv.cs new file mode 100644 index 0000000000..d2ccc0f810 --- /dev/null +++ b/src/vanilla/Model/CompositeTypeJv.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using AutoRest.Core.Utilities; +using AutoRest.Core.Model; +using AutoRest.Extensions; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class CompositeTypeJv : CompositeType, IModelTypeJv + { + public const string ExternalExtension = "x-ms-external"; + protected string _runtimePackage = "com.microsoft.rest"; + + public CompositeTypeJv() + { + } + + public CompositeTypeJv(string name) : base(name) + { + } + + [JsonIgnore] + public virtual string ModelsPackage => (this.CodeModel as CodeModelJv).ModelsPackage; + + [JsonIgnore] + public virtual string Package + { + get + { + if (Extensions.Get(ExternalExtension) == true) { + return _runtimePackage; + } + else + { + return string.Join( + ".", + CodeModel?.Namespace.ToLowerInvariant(), + "models"); + } + } + } + + [JsonIgnore] + public IEnumerable SubTypes + { + get + { + if (BaseIsPolymorphic) + { + foreach (CompositeType type in CodeModel.ModelTypes) + { + if (type.BaseModelType != null && + type.BaseModelType.SerializedName == this.SerializedName) + { + yield return type; + } + } + } + } + } + + [JsonIgnore] + public virtual string ExceptionTypeDefinitionName + { + get + { + if (this.Extensions.ContainsKey(SwaggerExtensions.NameOverrideExtension)) + { + var ext = this.Extensions[SwaggerExtensions.NameOverrideExtension] as Newtonsoft.Json.Linq.JContainer; + if (ext != null && ext["name"] != null) + { + return ext["name"].ToString(); + } + } + return this.Name + "Exception"; + } + } + + [JsonIgnore] + public bool NeedsFlatten + { + get + { + return Properties.OfType().Any(p => p.WasFlattened()); + } + } + + [JsonIgnore] + public virtual IEnumerable Imports + { + get + { + var imports = new List(); + if (Name.Contains('<')) + { + imports.AddRange(ParseGenericType().SelectMany(t => t.Imports)); + } + else + { + imports.Add(string.Join(".", Package, Name)); + } + return imports; + } + } + + [JsonIgnore] + public virtual IEnumerable ImportList + { + get + { + var classes = new HashSet(); + classes.AddRange(Properties.SelectMany(pm => (pm as PropertyJv).Imports)); + if (this.Properties.Any(p => !p.GetJsonProperty().IsNullOrEmpty())) + { + classes.Add("com.fasterxml.jackson.annotation.JsonProperty"); + } + // For polymorphism + if (BaseIsPolymorphic) + { + classes.Add("com.fasterxml.jackson.annotation.JsonTypeInfo"); + classes.Add("com.fasterxml.jackson.annotation.JsonTypeName"); + if (SubTypes.Any()) + { + classes.Add("com.fasterxml.jackson.annotation.JsonSubTypes"); + } + } + // For flattening + if (NeedsFlatten) + { + classes.Add("com.microsoft.rest.serializer.JsonFlatten"); + } + return classes.AsEnumerable(); + } + } + + [JsonIgnore] + public IModelTypeJv ResponseVariant => this; + + [JsonIgnore] + public IModelTypeJv ParameterVariant => this; + + [JsonIgnore] + public IModelTypeJv NonNullableVariant => this; + + protected IEnumerable ParseGenericType() + { + string name = Name; + string[] types = Name.ToString().Split(new String[] { "<", ">", ",", ", " }, StringSplitOptions.RemoveEmptyEntries); + foreach (var innerType in types.Where(t => !string.IsNullOrWhiteSpace(t))) + { + if (!CodeNamerJv.PrimaryTypes.Contains(innerType.Trim())) + { + yield return new CompositeTypeJv { Name = innerType.Trim(), CodeModel = CodeModel }; + } + } + } + } +} diff --git a/src/vanilla/Model/DictionaryTypeJv.cs b/src/vanilla/Model/DictionaryTypeJv.cs new file mode 100644 index 0000000000..1d1d3b174c --- /dev/null +++ b/src/vanilla/Model/DictionaryTypeJv.cs @@ -0,0 +1,58 @@ +using System.Collections.Generic; +using System.Linq; +using AutoRest.Core.Utilities; +using AutoRest.Core.Model; +using System; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class DictionaryTypeJv : DictionaryType, IModelTypeJv + { + public DictionaryTypeJv() + { + Name.OnGet += value => $"Map"; + } + + [JsonIgnore] + public IEnumerable Imports + { + get + { + List imports = new List { "java.util.Map" }; + return imports.Concat((this.ValueType as IModelTypeJv)?.Imports ?? Enumerable.Empty()); + } + } + + [JsonIgnore] + public IModelTypeJv ResponseVariant + { + get + { + var respvariant = (ValueType as IModelTypeJv).ResponseVariant; + if (respvariant != ValueType && (respvariant as PrimaryTypeJv)?.Nullable != false) + { + return new DictionaryTypeJv { ValueType = respvariant }; + } + return this; + } + } + + [JsonIgnore] + public IModelTypeJv ParameterVariant + { + get + { + var respvariant = (ValueType as IModelTypeJv).ParameterVariant; + if (respvariant != ValueType && (respvariant as PrimaryTypeJv)?.Nullable != false) + { + return new DictionaryTypeJv { ValueType = respvariant }; + } + return this; + } + } + + [JsonIgnore] + public IModelTypeJv NonNullableVariant => this; + } +} diff --git a/src/vanilla/Model/EnumTypeJv.cs b/src/vanilla/Model/EnumTypeJv.cs new file mode 100644 index 0000000000..d9b99c88d1 --- /dev/null +++ b/src/vanilla/Model/EnumTypeJv.cs @@ -0,0 +1,42 @@ +using System.Collections.Generic; +using System.Globalization; +using AutoRest.Core.Model; +using Newtonsoft.Json; +using AutoRest.Core; + +namespace AutoRest.Java.Model +{ + public class EnumTypeJv : EnumType, IModelTypeJv + { + public EnumTypeJv() + { + Name.OnGet += name => string.IsNullOrEmpty(name) || name == "enum" ? "String" : CodeNamer.Instance.GetTypeName(name); + } + + [JsonIgnore] + public virtual string ModelsPackage => (this.CodeModel as CodeModelJv).ModelsPackage; + + [JsonIgnore] + public virtual IEnumerable Imports + { + get + { + if (Name != "String") + { + yield return string.Join(".", + CodeModel?.Namespace.ToLowerInvariant(), + "models", Name); + } + } + } + + [JsonIgnore] + public IModelTypeJv ResponseVariant => this; + + [JsonIgnore] + public IModelTypeJv ParameterVariant => this; + + [JsonIgnore] + public IModelTypeJv NonNullableVariant => this; + } +} diff --git a/src/vanilla/Model/IModelTypeJv.cs b/src/vanilla/Model/IModelTypeJv.cs new file mode 100644 index 0000000000..4bdf5ce90c --- /dev/null +++ b/src/vanilla/Model/IModelTypeJv.cs @@ -0,0 +1,34 @@ +using AutoRest.Core.Model; +using System.Collections.Generic; + +namespace AutoRest.Java.Model +{ + public interface IModelTypeJv : IModelType + { + IEnumerable Imports { get; } + + IModelTypeJv ResponseVariant { get; } + IModelTypeJv ParameterVariant { get; } + + IModelTypeJv NonNullableVariant { get; } + } + + public static class IModelTypeExtensions + { + public static IModelType ServiceResponseVariant(this IModelType original, bool wantNullable = false) + { + if (wantNullable) + { + return original; // the original is always nullable + } + return (original as IModelTypeJv)?.ResponseVariant?.NonNullableVariant ?? original; + } + + public static string GetDefaultValue(this IModelType type, Method parent) + { + return type is PrimaryTypeJv && type.Name == "RequestBody" + ? "RequestBody.create(MediaType.parse(\"" + parent.RequestContentType + "\"), new byte[0])" + : type.DefaultValue; + } + } +} diff --git a/src/vanilla/Model/MethodGroupJv.cs b/src/vanilla/Model/MethodGroupJv.cs new file mode 100644 index 0000000000..40beae29c3 --- /dev/null +++ b/src/vanilla/Model/MethodGroupJv.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using AutoRest.Core.Utilities; +using AutoRest.Core.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class MethodGroupJv : MethodGroup + { + public MethodGroupJv() + { + Name.OnGet += Core.Utilities.Extensions.ToCamelCase; + } + public MethodGroupJv(string name) : base(name) + { + Name.OnGet += Core.Utilities.Extensions.ToCamelCase; + } + + [JsonIgnore] + public string MethodGroupFullType + { + get + { + return (CodeModel.Namespace.ToLowerInvariant()) + "." + TypeName; + } + } + + [JsonIgnore] + public virtual string MethodGroupDeclarationType + { + get + { + return TypeName; + } + } + + [JsonIgnore] + public string MethodGroupImplType + { + get + { + return TypeName + ImplClassSuffix; + } + } + + [JsonIgnore] + public virtual string ImplClassSuffix + { + get + { + return "Impl"; + } + } + + [JsonIgnore] + public virtual string ParentDeclaration + { + get + { + return " implements " + MethodGroupTypeString; + } + } + + [JsonIgnore] + public virtual string ImplPackage + { + get + { + return "implementation"; + } + } + + [JsonIgnore] + public string MethodGroupTypeString + { + get + { + if (this.Methods + .OfType() + .SelectMany(m => m.ImplImports) + .Any(i => i.Split('.').LastOrDefault() == TypeName)) + { + return MethodGroupFullType; + } + return TypeName; + } + } + + [JsonIgnore] + public string MethodGroupServiceType + { + get + { + return CodeNamerJv.GetServiceName(Name.ToPascalCase()); + } + } + + [JsonIgnore] + public virtual string ServiceClientType + { + get + { + return CodeModel.Name + "Impl"; + } + } + + [JsonIgnore] + public virtual IEnumerable ImplImports + { + get + { + var imports = new List(); + imports.Add("retrofit2.Retrofit"); + if (MethodGroupTypeString == TypeName) + { + imports.Add(MethodGroupFullType); + } + imports.AddRange(this.Methods + .OfType() + .SelectMany(m => m.ImplImports) + .OrderBy(i => i).Distinct()); + return imports; + } + } + + [JsonIgnore] + public virtual IEnumerable InterfaceImports + { + get + { + return this.Methods + .OfType() + .SelectMany(m => m.InterfaceImports) + .OrderBy(i => i).Distinct(); + } + } + } +} \ No newline at end of file diff --git a/src/vanilla/Model/MethodJv.cs b/src/vanilla/Model/MethodJv.cs new file mode 100644 index 0000000000..53f91b4e0d --- /dev/null +++ b/src/vanilla/Model/MethodJv.cs @@ -0,0 +1,791 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Text; +using AutoRest.Core; +using AutoRest.Core.Utilities; +using AutoRest.Extensions; +using AutoRest.Core.Model; +using Newtonsoft.Json; +using AutoRest.Core.Utilities.Collections; + +namespace AutoRest.Java.Model +{ + public class MethodJv : Method + { + [JsonIgnore] + public virtual IEnumerable RetrofitParameters + { + get + { + var parameters = LogicalParameters.OfType().Where(p => p.Location != ParameterLocation.None) + .Where(p => !p.Extensions.ContainsKey("hostParameter")).ToList(); + if (IsParameterizedHost) + { + parameters.Add(new ParameterJv + { + Name = "parameterizedHost", + SerializedName = "x-ms-parameterized-host", + Location = ParameterLocation.Header, + IsRequired = true, + ModelType = new PrimaryTypeJv(KnownPrimaryType.String) + }); + } + return parameters; + } + } + + [JsonIgnore] + public IEnumerable OrderedRetrofitParameters + { + get + { + return RetrofitParameters.Where(p => p.Location == ParameterLocation.Path) + .Union(RetrofitParameters.Where(p => p.Location != ParameterLocation.Path)); + } + } + + /// + /// Generate the method parameter declarations for a method + /// + [JsonIgnore] + public virtual string MethodParameterApiDeclaration + { + get + { + List declarations = new List(); + foreach (ParameterJv parameter in OrderedRetrofitParameters) + { + StringBuilder declarationBuilder = new StringBuilder(); + if (Url.Contains("{" + parameter.Name + "}")) + { + parameter.Location = ParameterLocation.Path; + } + if (parameter.Location == ParameterLocation.Path || + parameter.Location == ParameterLocation.Query || + parameter.Location == ParameterLocation.Header) + { + declarationBuilder.Append(string.Format(CultureInfo.InvariantCulture, + "@{0}(\"{1}\") ", + parameter.Location.ToString(), + parameter.SerializedName)); + } + else if (parameter.Location == ParameterLocation.Body) + { + declarationBuilder.Append(string.Format(CultureInfo.InvariantCulture, + "@{0} ", + parameter.Location.ToString())); + } + else if (parameter.Location == ParameterLocation.FormData) + { + declarationBuilder.Append(string.Format(CultureInfo.InvariantCulture, + "@Part(\"{0}\") ", + parameter.SerializedName)); + } + var declarativeName = parameter.ClientProperty != null ? parameter.ClientProperty.Name : parameter.Name; + declarationBuilder.Append(parameter.WireType.Name); + declarationBuilder.Append(" " + declarativeName); + declarations.Add(declarationBuilder.ToString()); + } + + var declaration = string.Join(", ", declarations); + return declaration; + } + } + + [JsonIgnore] + public virtual string MethodParameterDeclaration + { + get + { + List declarations = new List(); + foreach (var parameter in LocalParameters.Where(p => !p.IsConstant)) + { + declarations.Add(parameter.ClientType.ParameterVariant.Name + " " + parameter.Name); + } + + var declaration = string.Join(", ", declarations); + return declaration; + } + } + + [JsonIgnore] + public virtual string MethodRequiredParameterDeclaration + { + get + { + List declarations = new List(); + foreach (var parameter in LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) + { + declarations.Add(parameter.ClientType.ParameterVariant.Name + " " + parameter.Name); + } + + var declaration = string.Join(", ", declarations); + return declaration; + } + } + + [JsonIgnore] + public string MethodParameterInvocation + { + get + { + List invocations = new List(); + foreach (var parameter in LocalParameters.Where(p => !p.IsConstant)) + { + invocations.Add(parameter.Name); + } + + var declaration = string.Join(", ", invocations); + return declaration; + } + } + + [JsonIgnore] + public string MethodDefaultParameterInvocation + { + get + { + List invocations = new List(); + foreach (var parameter in LocalParameters) + { + if (parameter.IsRequired) + { + invocations.Add(parameter.Name); + } + else + { + invocations.Add("null"); + } + } + + var declaration = string.Join(", ", invocations); + return declaration; + } + } + + [JsonIgnore] + public string MethodRequiredParameterInvocation + { + get + { + List invocations = new List(); + foreach (var parameter in LocalParameters) + { + if (parameter.IsRequired && !parameter.IsConstant) + { + invocations.Add(parameter.Name); + } + } + + var declaration = string.Join(", ", invocations); + return declaration; + } + } + + [JsonIgnore] + public string MethodParameterApiInvocation + { + get + { + List invocations = new List(); + foreach (var parameter in OrderedRetrofitParameters) + { + invocations.Add(parameter.WireName); + } + + var declaration = string.Join(", ", invocations); + return declaration; + } + } + + [JsonIgnore] + public string MethodRequiredParameterApiInvocation + { + get + { + List invocations = new List(); + foreach (var parameter in OrderedRetrofitParameters) + { + invocations.Add(parameter.WireName); + } + + var declaration = string.Join(", ", invocations); + return declaration; + } + } + + [JsonIgnore] + public virtual bool IsParameterizedHost => CodeModel.Extensions.ContainsKey(SwaggerExtensions.ParameterizedHostExtension); + + /// + /// Generate a reference to the ServiceClient + /// + [JsonIgnore] + public string ClientReference => Group.IsNullOrEmpty() ? "this" : "this.client"; + + [JsonIgnore] + public string ParameterConversion + { + get + { + IndentedStringBuilder builder = new IndentedStringBuilder(); + foreach (var p in RetrofitParameters) + { + if (p.NeedsConversion) + { + builder.Append(p.ConvertToWireType(p.Name, ClientReference)); + } + } + return builder.ToString(); + } + } + + [JsonIgnore] + public string RequiredParameterConversion + { + get + { + IndentedStringBuilder builder = new IndentedStringBuilder(); + foreach (var p in RetrofitParameters.Where(p => p.IsRequired)) + { + if (p.NeedsConversion) + { + builder.Append(p.ConvertToWireType(p.Name, ClientReference)); + } + } + return builder.ToString(); + } + } + + /// + /// Generates input mapping code block. + /// + /// + public virtual string BuildInputMappings(bool filterRequired = false) + { + var builder = new IndentedStringBuilder(); + foreach (var transformation in InputParameterTransformation) + { + var outParamName = transformation.OutputParameter.Name; + while (Parameters.Any(p => p.Name == outParamName)) + { + outParamName += "1"; + } + transformation.OutputParameter.Name = outParamName; + var nullCheck = BuildNullCheckExpression(transformation); + bool conditionalAssignment = !string.IsNullOrEmpty(nullCheck) && !transformation.OutputParameter.IsRequired && !filterRequired; + if (conditionalAssignment) + { + builder.AppendLine("{0} {1} = null;", + ((ParameterJv) transformation.OutputParameter).ClientType.ParameterVariant.Name, + outParamName); + builder.AppendLine("if ({0}) {{", nullCheck).Indent(); + } + + if (transformation.ParameterMappings.Any(m => !string.IsNullOrEmpty(m.OutputParameterProperty)) && + transformation.OutputParameter.ModelType is CompositeType) + { + builder.AppendLine("{0}{1} = new {2}();", + !conditionalAssignment ? ((ParameterJv)transformation.OutputParameter).ClientType.ParameterVariant.Name + " " : "", + outParamName, + transformation.OutputParameter.ModelType.Name); + } + + foreach (var mapping in transformation.ParameterMappings) + { + builder.AppendLine("{0}{1}{2};", + !conditionalAssignment && !(transformation.OutputParameter.ModelType is CompositeType) ? + ((ParameterJv)transformation.OutputParameter).ClientType.ParameterVariant.Name + " " : "", + outParamName, + GetMapping(mapping, filterRequired)); + } + + if (conditionalAssignment) + { + builder.Outdent() + .AppendLine("}"); + } + } + + return builder.ToString(); + } + + private static string GetMapping(ParameterMapping mapping, bool filterRequired = false) + { + string inputPath = mapping.InputParameter.Name; + if (mapping.InputParameterProperty != null) + { + inputPath += "." + CodeNamer.Instance.CamelCase(mapping.InputParameterProperty) + "()"; + } + if (filterRequired && !mapping.InputParameter.IsRequired) + { + inputPath = "null"; + } + + string outputPath = ""; + if (mapping.OutputParameterProperty != null) + { + outputPath += ".with" + CodeNamer.Instance.PascalCase(mapping.OutputParameterProperty); + return string.Format(CultureInfo.InvariantCulture, "{0}({1})", outputPath, inputPath); + } + else + { + return string.Format(CultureInfo.InvariantCulture, "{0} = {1}", outputPath, inputPath); + } + } + + private static string BuildNullCheckExpression(ParameterTransformation transformation) + { + if (transformation == null) + { + throw new ArgumentNullException("transformation"); + } + + return string.Join(" || ", + transformation.ParameterMappings + .Where(m => !m.InputParameter.IsRequired) + .Select(m => m.InputParameter.Name + " != null")); + } + + [JsonIgnore] + public IEnumerable RequiredNullableParameters + { + get + { + foreach (ParameterJv param in Parameters) + { + if (!param.ModelType.IsPrimaryType(KnownPrimaryType.Int) && + !param.ModelType.IsPrimaryType(KnownPrimaryType.Double) && + !param.ModelType.IsPrimaryType(KnownPrimaryType.Boolean) && + !param.ModelType.IsPrimaryType(KnownPrimaryType.Long) && + !param.ModelType.IsPrimaryType(KnownPrimaryType.UnixTime) && + !param.IsConstant && param.IsRequired) + { + yield return param; + } + } + } + } + + [JsonIgnore] + public IEnumerable ParametersToValidate + { + get + { + foreach (ParameterJv param in Parameters) + { + if (param.ModelType is PrimaryType || + param.ModelType is EnumType || + param.IsConstant) + { + continue; + } + yield return param; + } + } + } + + /// + /// Gets the expression for response body initialization + /// + [JsonIgnore] + public virtual string InitializeResponseBody + { + get + { + return string.Empty; + } + } + + [JsonIgnore] + public virtual string MethodParameterDeclarationWithCallback + { + get + { + var parameters = MethodParameterDeclaration; + if (!parameters.IsNullOrEmpty()) + { + parameters += ", "; + } + parameters += string.Format(CultureInfo.InvariantCulture, "final ServiceCallback<{0}> serviceCallback", + ReturnTypeJv.GenericBodyClientTypeString); + return parameters; + } + } + + [JsonIgnore] + public virtual string MethodRequiredParameterDeclarationWithCallback + { + get + { + var parameters = MethodRequiredParameterDeclaration; + if (!parameters.IsNullOrEmpty()) + { + parameters += ", "; + } + parameters += string.Format(CultureInfo.InvariantCulture, "final ServiceCallback<{0}> serviceCallback", + ReturnTypeJv.GenericBodyClientTypeString); + return parameters; + } + } + + [JsonIgnore] + public virtual string MethodParameterInvocationWithCallback + { + get + { + var parameters = MethodParameterInvocation; + if (!parameters.IsNullOrEmpty()) + { + parameters += ", "; + } + parameters += "serviceCallback"; + return parameters; + } + } + + [JsonIgnore] + public virtual string MethodRequiredParameterInvocationWithCallback + { + get + { + var parameters = MethodDefaultParameterInvocation; + if (!parameters.IsNullOrEmpty()) + { + parameters += ", "; + } + parameters += "serviceCallback"; + return parameters; + } + } + + /// + /// Get the parameters that are actually method parameters in the order they appear in the method signature + /// exclude global parameters + /// + [JsonIgnore] + public IEnumerable LocalParameters + { + get + { + //Omit parameter-group properties for now since Java doesn't support them yet + var par = Parameters + .OfType() + .Where(p => p != null && !p.IsClientProperty && !string.IsNullOrWhiteSpace(p.Name)) + .OrderBy(item => !item.IsRequired) + .ToList(); + return par; + } + } + + [JsonIgnore] + public string HostParameterReplacementArgs + { + get + { + var args = new List(); + foreach (var param in Parameters.Where(p => p.Extensions.ContainsKey("hostParameter"))) + { + args.Add("\"{" + param.SerializedName + "}\", " + param.Name); + } + return string.Join(", ", args); + } + } + + /// + /// Get the type for operation exception + /// + [JsonIgnore] + public virtual string OperationExceptionTypeString + { + get + { + if (this.DefaultResponse.Body is CompositeType) + { + var type = this.DefaultResponse.Body as CompositeTypeJv; + return type.ExceptionTypeDefinitionName; + } + else + { + return "RestException"; + } + } + } + + [JsonIgnore] + public virtual IEnumerable Exceptions + { + get + { + yield return OperationExceptionTypeString; + yield return "IOException"; + if (RequiredNullableParameters.Any()) + { + yield return "IllegalArgumentException"; + } + } + } + + [JsonIgnore] + public virtual string ExceptionString + { + get + { + return string.Join(", ", Exceptions); + } + } + + [JsonIgnore] + public virtual List ExceptionStatements + { + get + { + List exceptions = new List(); + exceptions.Add(OperationExceptionTypeString + " exception thrown from REST call"); + exceptions.Add("IOException exception thrown from serialization/deserialization"); + if (RequiredNullableParameters.Any()) + { + exceptions.Add("IllegalArgumentException exception thrown from invalid parameters"); + } + return exceptions; + } + } + + [JsonIgnore] + public string CallType + { + get + { + if (this.HttpMethod == HttpMethod.Head) + { + return "Void"; + } + else + { + return "ResponseBody"; + } + } + } + + [JsonIgnore] + public virtual string ResponseBuilder + { + get + { + return "ServiceResponseBuilder"; + } + } + + [JsonIgnore] + public virtual string RuntimeBasePackage + { + get + { + return "com.microsoft.rest"; + } + } + + [JsonIgnore] + public ResponseJv ReturnTypeJv => ReturnType as ResponseJv; + + [JsonIgnore] + public virtual string ReturnTypeResponseName => ReturnTypeJv?.BodyClientType?.ServiceResponseVariant()?.Name; + + public virtual string ResponseGeneration(bool filterRequired = false) + { + if (ReturnTypeJv.NeedsConversion) + { + IndentedStringBuilder builder= new IndentedStringBuilder(); + builder.AppendLine("ServiceResponse<{0}> response = {1}Delegate(call.execute());", + ReturnTypeJv.GenericBodyWireTypeString, this.Name.ToCamelCase()); + builder.AppendLine("{0} body = null;", ReturnTypeJv.BodyClientType.Name) + .AppendLine("if (response.body() != null) {") + .Indent().AppendLine("{0}", ReturnTypeJv.ConvertBodyToClientType("response.body()", "body")) + .Outdent().AppendLine("}"); + return builder.ToString(); + } + return ""; + } + + [JsonIgnore] + public virtual string ReturnValue + { + get + { + if (ReturnTypeJv.NeedsConversion) + { + return "new ServiceResponse<" + ReturnTypeJv.GenericBodyClientTypeString + ">(body, response.response())"; + } + return this.Name + "Delegate(call.execute())"; + } + } + + public virtual string SuccessCallback(bool filterRequired = false) + { + IndentedStringBuilder builder = new IndentedStringBuilder(); + if (ReturnTypeJv.NeedsConversion) + { + builder.AppendLine("ServiceResponse<{0}> result = {1}Delegate(response);", ReturnTypeJv.GenericBodyWireTypeString, this.Name); + builder.AppendLine("{0} body = null;", ReturnTypeJv.BodyClientType.Name) + .AppendLine("if (result.body() != null) {") + .Indent().AppendLine("{0}", ReturnTypeJv.ConvertBodyToClientType("result.body()", "body")) + .Outdent().AppendLine("}"); + builder.AppendLine("ServiceResponse<{0}> clientResponse = new ServiceResponse<{0}>(body, result.response());", + ReturnTypeJv.GenericBodyClientTypeString); + builder.AppendLine("if (serviceCallback != null) {") + .Indent().AppendLine("serviceCallback.success(clientResponse);", ReturnTypeJv.GenericBodyClientTypeString) + .Outdent().AppendLine("}"); + builder.AppendLine("serviceFuture.success(clientResponse);"); + } + else + { + builder.AppendLine("{0} clientResponse = {1}Delegate(response);", ReturnTypeJv.WireResponseTypeString, this.Name); + builder.AppendLine("if (serviceCallback != null) {") + .Indent().AppendLine("serviceCallback.success(clientResponse);", this.Name) + .Outdent().AppendLine("}"); + builder.AppendLine("serviceFuture.success(clientResponse);"); + } + return builder.ToString(); + } + + public virtual string ClientResponse(bool filterRequired = false) + { + IndentedStringBuilder builder = new IndentedStringBuilder(); + if (ReturnTypeJv.NeedsConversion) + { + builder.AppendLine("ServiceResponse<{0}> result = {1}Delegate(response);", ReturnTypeJv.GenericBodyWireTypeString, this.Name); + builder.AppendLine("{0} body = null;", ReturnTypeJv.BodyClientType.Name) + .AppendLine("if (result.body() != null) {") + .Indent().AppendLine("{0}", ReturnTypeJv.ConvertBodyToClientType("result.body()", "body")) + .Outdent().AppendLine("}"); + builder.AppendLine("ServiceResponse<{0}> clientResponse = new ServiceResponse<{0}>(body, result.response());", + ReturnTypeJv.GenericBodyClientTypeString); + } + else + { + builder.AppendLine("{0} clientResponse = {1}Delegate(response);", ReturnTypeJv.WireResponseTypeString, this.Name); + } + return builder.ToString(); + } + + [JsonIgnore] + public virtual string ServiceFutureFactoryMethod + { + get + { + string factoryMethod = "fromResponse"; + if (ReturnType.Headers != null) + { + factoryMethod = "fromHeaderResponse"; + } + return factoryMethod; + } + } + + [JsonIgnore] + public virtual string CallbackDocumentation + { + get + { + return " * @param serviceCallback the async ServiceCallback to handle successful and failed responses."; + } + } + + [JsonIgnore] + public virtual List InterfaceImports + { + get + { + HashSet imports = new HashSet(); + // static imports + imports.Add("rx.Observable"); + imports.Add("com.microsoft.rest.ServiceFuture"); + imports.Add("com.microsoft.rest." + ReturnTypeJv.ClientResponseType); + imports.Add("com.microsoft.rest.ServiceCallback"); + // parameter types + this.Parameters.OfType().ForEach(p => imports.AddRange(p.InterfaceImports)); + // return type + imports.AddRange(this.ReturnTypeJv.InterfaceImports); + // exceptions + this.ExceptionString.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries) + .ForEach(ex => + { + string exceptionImport = CodeNamerJv.GetJavaException(ex, CodeModel); + if (exceptionImport != null) imports.Add(CodeNamerJv.GetJavaException(ex, CodeModel)); + }); return imports.ToList(); + } + } + + [JsonIgnore] + public virtual List ImplImports + { + get + { + HashSet imports = new HashSet(); + // static imports + imports.Add("rx.Observable"); + imports.Add("rx.functions.Func1"); + if (RequestContentType == "multipart/form-data" || RequestContentType == "application/x-www-form-urlencoded") + { + imports.Add("retrofit2.http.Multipart"); + } + else + { + imports.Add("retrofit2.http.Headers"); + } + imports.Add("retrofit2.Response"); + if (this.HttpMethod != HttpMethod.Head) + { + imports.Add("okhttp3.ResponseBody"); + } + imports.Add("com.microsoft.rest.ServiceFuture"); + imports.Add("com.microsoft.rest." + ReturnTypeJv.ClientResponseType); + imports.Add("com.microsoft.rest.ServiceCallback"); + this.RetrofitParameters.ForEach(p => imports.AddRange(p.RetrofitImports)); + // Http verb annotations + imports.Add(this.HttpMethod.ImportFrom()); + // response type conversion + if (this.Responses.Any()) + { + imports.Add("com.google.common.reflect.TypeToken"); + } + // validation + if (!ParametersToValidate.IsNullOrEmpty()) + { + imports.Add("com.microsoft.rest.Validator"); + } + // parameters + this.LocalParameters.Concat(this.LogicalParameters.OfType()) + .ForEach(p => imports.AddRange(p.ClientImplImports)); + this.RetrofitParameters.ForEach(p => imports.AddRange(p.WireImplImports)); + // return type + imports.AddRange(this.ReturnTypeJv.ImplImports); + if (ReturnType.Body.IsPrimaryType(KnownPrimaryType.Stream)) + { + imports.Add("retrofit2.http.Streaming"); + } + // response type (can be different from return type) + this.Responses.ForEach(r => imports.AddRange((r.Value as ResponseJv).ImplImports)); + // exceptions + this.ExceptionString.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries) + .ForEach(ex => + { + string exceptionImport = CodeNamerJv.GetJavaException(ex, CodeModel); + if (exceptionImport != null) imports.Add(CodeNamerJv.GetJavaException(ex, CodeModel)); + }); + // parameterized host + if (IsParameterizedHost) + { + imports.Add("com.google.common.base.Joiner"); + } + return imports.ToList(); + } + } + } +} \ No newline at end of file diff --git a/src/vanilla/Model/PackageInfoTemplateModel.cs b/src/vanilla/Model/PackageInfoTemplateModel.cs new file mode 100644 index 0000000000..6f72b0a5f6 --- /dev/null +++ b/src/vanilla/Model/PackageInfoTemplateModel.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; + +namespace AutoRest.Java.Model +{ + public class PackageInfoTemplateModel + { + public string Title { get; private set; } + public string Description { get; private set; } + public string SubPackage { get; private set; } + + public PackageInfoTemplateModel(CodeModel cm, string subPackage = null) + { + Title = cm.Name; + Description = cm.Documentation; + SubPackage = subPackage; + } + } +} \ No newline at end of file diff --git a/src/vanilla/Model/ParameterJv.cs b/src/vanilla/Model/ParameterJv.cs new file mode 100644 index 0000000000..5b5611de94 --- /dev/null +++ b/src/vanilla/Model/ParameterJv.cs @@ -0,0 +1,304 @@ +using System.Collections.Generic; +using System.Globalization; +using AutoRest.Core.Utilities; +using AutoRest.Core.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class ParameterJv : Parameter + { + public ParameterJv() + : base() + { + _implImports = new List(); + Name.OnGet += name => !IsClientProperty + ? name + : string.Format(CultureInfo.InvariantCulture, + "{0}.{1}()", + Method != null && true == Method.Group.IsNullOrEmpty() ? "this" : "this.client", + ClientProperty.Name.ToCamelCase()); + } + + [JsonIgnore] + public bool WantNullable => IsXNullable ?? !IsRequired; + + public override IModelType ModelType + { + get + { + if (base.ModelType == null) + { + return null; + } + return WantNullable + ? base.ModelType + : (base.ModelType as IModelTypeJv).NonNullableVariant; + } + set + { + base.ModelType = value; + } + } + + [JsonIgnore] + public IModelTypeJv ClientType + { + get + { + return ((IModelTypeJv)ModelType).ParameterVariant; + } + } + + [JsonIgnore] + public IModelTypeJv WireType + { + get + { + if (ModelType.IsPrimaryType(KnownPrimaryType.Stream)) + { + var res = new PrimaryTypeJv(KnownPrimaryType.Stream); + res.Name.FixedValue = "RequestBody"; + return res; + } + else if (!ModelType.IsPrimaryType(KnownPrimaryType.Base64Url) && + Location != Core.Model.ParameterLocation.Body && + Location != Core.Model.ParameterLocation.FormData && + NeedsSpecialSerialization(ClientType)) + { + return new PrimaryTypeJv(KnownPrimaryType.String); + } + else + { + return (IModelTypeJv) ModelType; + } + } + } + + [JsonIgnore] + public string WireName => NeedsConversion ? this.Name.ToCamelCase() + "Converted" : this.Name.ToString(); + + [JsonIgnore] + public bool NeedsConversion => !ClientType.StructurallyEquals(WireType); + + public string ConvertToWireType(string source, string clientReference) + { + if (Location != Core.Model.ParameterLocation.Body && + Location != Core.Model.ParameterLocation.FormData && + NeedsSpecialSerialization(ModelType)) + { + var primary = ClientType as PrimaryTypeJv; + var sequence = ClientType as SequenceTypeJv; + if (primary != null && primary.IsPrimaryType(KnownPrimaryType.ByteArray)) + { + if (WireType.IsPrimaryType(KnownPrimaryType.String)) + { + return string.Format(CultureInfo.InvariantCulture, "{0} {1} = Base64.encodeBase64String({2});", WireType.Name, WireName, source); + } + else + { + return string.Format(CultureInfo.InvariantCulture, "{0} {1} = Base64Url.encode({2});", WireType.Name, WireName, source); + } + } + else if (sequence != null) + { + return string.Format(CultureInfo.InvariantCulture, + "{0} {1} = {2}.serializerAdapter().serializeList({3}, CollectionFormat.{4});", + WireType.Name, + WireName, + clientReference, + source, + CollectionFormat.ToString().ToUpperInvariant()); + } + } + + return convertClientTypeToWireType(WireType, source, WireName, clientReference); + } + + private string convertClientTypeToWireType(IModelTypeJv wireType, string source, string target, string clientReference, int level = 0) + { + IndentedStringBuilder builder = new IndentedStringBuilder(); + if (wireType.IsPrimaryType(KnownPrimaryType.DateTimeRfc1123)) + { + if (!IsRequired) + { + builder.AppendLine("DateTimeRfc1123 {0} = {1};", target, wireType.GetDefaultValue(Method) ?? "null") + .AppendLine("if ({0} != null) {{", source).Indent(); + } + builder.AppendLine("{0}{1} = new DateTimeRfc1123({2});", IsRequired ? "DateTimeRfc1123 " : "", target, source); + if (!IsRequired) + { + builder.Outdent().AppendLine("}"); + } + } + else if (wireType.IsPrimaryType(KnownPrimaryType.UnixTime)) + { + if (!IsRequired) + { + builder.AppendLine("Long {0} = {1};", target, wireType.GetDefaultValue(Method) ?? "null") + .AppendLine("if ({0} != null) {{", source).Indent(); + } + builder.AppendLine("{0}{1} = {2}.toDateTime(DateTimeZone.UTC).getMillis() / 1000;", IsRequired ? "Long " : "", target, source); + } + else if (wireType.IsPrimaryType(KnownPrimaryType.Base64Url)) + { + if (!IsRequired) + { + builder.AppendLine("Base64Url {0} = {1};", target, wireType.GetDefaultValue(Method) ?? "null") + .AppendLine("if ({0} != null) {{", source).Indent(); + } + builder.AppendLine("{0}{1} = Base64Url.encode({2});", IsRequired ? "Base64Url " : "", target, source); + if (!IsRequired) + { + builder.Outdent().AppendLine("}"); + } + } + else if (wireType.IsPrimaryType(KnownPrimaryType.Stream)) + { + if (!IsRequired) + { + builder.AppendLine("RequestBody {0} = {1};", target, wireType.GetDefaultValue(Method) ?? "null") + .AppendLine("if ({0} != null) {{", source).Indent(); + } + builder.AppendLine("{0}{1} = RequestBody.create(MediaType.parse(\"{2}\"), {3});", + IsRequired ? "RequestBody " : "", target, Method.RequestContentType, source); + if (!IsRequired) + { + builder.Outdent().AppendLine("}"); + } + } + else if (wireType is SequenceTypeJv) + { + if (!IsRequired) + { + builder.AppendLine("{0} {1} = {2};", WireType.Name, target, wireType.GetDefaultValue(Method) ?? "null") + .AppendLine("if ({0} != null) {{", source).Indent(); + } + var sequenceType = wireType as SequenceTypeJv; + var elementType = sequenceType.ElementType as IModelTypeJv; + var itemName = string.Format(CultureInfo.InvariantCulture, "item{0}", level == 0 ? "" : level.ToString(CultureInfo.InvariantCulture)); + var itemTarget = string.Format(CultureInfo.InvariantCulture, "value{0}", level == 0 ? "" : level.ToString(CultureInfo.InvariantCulture)); + builder.AppendLine("{0}{1} = new ArrayList<{2}>();", IsRequired ? wireType.Name + " " : "", target, elementType.Name) + .AppendLine("for ({0} {1} : {2}) {{", elementType.ParameterVariant.Name, itemName, source) + .Indent().AppendLine(convertClientTypeToWireType(elementType, itemName, itemTarget, clientReference, level + 1)) + .AppendLine("{0}.add({1});", target, itemTarget) + .Outdent().Append("}"); + _implImports.Add("java.util.ArrayList"); + if (!IsRequired) + { + builder.Outdent().AppendLine("}"); + } + } + else if (wireType is DictionaryTypeJv) + { + if (!IsRequired) + { + builder.AppendLine("{0} {1} = {2};", WireType.Name, target, wireType.GetDefaultValue(Method) ?? "null") + .AppendLine("if ({0} != null) {{", source).Indent(); + } + var dictionaryType = wireType as DictionaryTypeJv; + var valueType = dictionaryType.ValueType as IModelTypeJv; + var itemName = string.Format(CultureInfo.InvariantCulture, "entry{0}", level == 0 ? "" : level.ToString(CultureInfo.InvariantCulture)); + var itemTarget = string.Format(CultureInfo.InvariantCulture, "value{0}", level == 0 ? "" : level.ToString(CultureInfo.InvariantCulture)); + builder.AppendLine("{0}{1} = new HashMap();", IsRequired ? wireType.Name + " " : "", target, valueType.Name) + .AppendLine("for (Map.Entry {1} : {2}.entrySet()) {{", valueType.ParameterVariant.Name, itemName, source) + .Indent().AppendLine(convertClientTypeToWireType(valueType, itemName + ".getValue()", itemTarget, clientReference, level + 1)) + .AppendLine("{0}.put({1}.getKey(), {2});", target, itemName, itemTarget) + .Outdent().Append("}"); + _implImports.Add("java.util.HashMap"); + if (!IsRequired) + { + builder.Outdent().AppendLine("}"); + } + } + return builder.ToString(); + } + + [JsonIgnore] + public IEnumerable InterfaceImports + { + get + { + return ClientType.Imports; + } + } + + [JsonIgnore] + public IEnumerable RetrofitImports + { + get + { + var imports = new List(); + // type imports + if (this.Location == Core.Model.ParameterLocation.Body || !NeedsSpecialSerialization(ModelType)) + { + imports.AddRange(WireType.Imports); + } + // parameter location + imports.Add(LocationImport(this.Location)); + return imports; + } + } + + private List _implImports; + + [JsonIgnore] + public IEnumerable ClientImplImports + { + get + { + return ClientType.Imports; + } + } + + [JsonIgnore] + public IEnumerable WireImplImports + { + get + { + var imports = new List(WireType.Imports); + if (Location != Core.Model.ParameterLocation.Body) + { + if (this.ModelType.IsPrimaryType(KnownPrimaryType.ByteArray)) + { + imports.Add("org.apache.commons.codec.binary.Base64"); + } + else if (this.ModelType is SequenceType) + { + imports.Add("com.microsoft.rest.CollectionFormat"); + } + } + if (ModelType.IsPrimaryType(KnownPrimaryType.Stream) && Location == Core.Model.ParameterLocation.Body) + { + imports.Add("okhttp3.RequestBody"); + imports.Add("okhttp3.MediaType"); + } + return imports; + } + } + + private string LocationImport(ParameterLocation parameterLocation) + { + if (parameterLocation == Core.Model.ParameterLocation.FormData) + { + return "retrofit2.http.Part"; + } + else if (parameterLocation != Core.Model.ParameterLocation.None) + { + return "retrofit2.http." + parameterLocation.ToString(); + } + else + { + return null; + } + } + + private bool NeedsSpecialSerialization(IModelType type) + { + var known = type as PrimaryType; + return known != null && + type.IsPrimaryType(KnownPrimaryType.ByteArray) || + type is SequenceType; + } + } +} diff --git a/src/vanilla/Model/PrimaryTypeJv.cs b/src/vanilla/Model/PrimaryTypeJv.cs new file mode 100644 index 0000000000..d705864943 --- /dev/null +++ b/src/vanilla/Model/PrimaryTypeJv.cs @@ -0,0 +1,223 @@ +using System; +using System.Collections.Generic; +using AutoRest.Core.Utilities; +using AutoRest.Core.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class PrimaryTypeJv : PrimaryType, IModelTypeJv + { + public PrimaryTypeJv() + { + Name.OnGet += v => ImplementationName; + } + + public PrimaryTypeJv(KnownPrimaryType type) + : base(type) + { + Name.OnGet += v => ImplementationName; + } + + public bool WantNullable { get; private set; } = true; + + [JsonIgnore] + public bool Nullable + { + get + { + if (WantNullable) + { + return true; + } + switch (KnownPrimaryType) + { + case KnownPrimaryType.None: + case KnownPrimaryType.Boolean: + case KnownPrimaryType.Double: + case KnownPrimaryType.Int: + case KnownPrimaryType.Long: + case KnownPrimaryType.UnixTime: + return false; + } + return true; + } + } + + [JsonIgnore] + public override string DefaultValue + { + get + { + if (Name == "byte[]") + { + return "new byte[0]"; + } + else if (Name == "Byte[]") + { + return "new Byte[0]"; + } + else if (Nullable) + { + return null; + } + else + { + throw new NotSupportedException(this.Name + " does not have default value!"); + } + } + } + + [JsonIgnore] + public IModelTypeJv ParameterVariant + { + get + { + if (KnownPrimaryType == KnownPrimaryType.DateTimeRfc1123) + { + return new PrimaryTypeJv(KnownPrimaryType.DateTime); + } + else if (KnownPrimaryType == KnownPrimaryType.UnixTime) + { + return new PrimaryTypeJv(KnownPrimaryType.DateTime); + } + else if (KnownPrimaryType == KnownPrimaryType.Base64Url) + { + return new PrimaryTypeJv(KnownPrimaryType.ByteArray); + } + else if (KnownPrimaryType == KnownPrimaryType.Stream) + { + return new PrimaryTypeJv(KnownPrimaryType.ByteArray); + } + else + { + return this; + } + } + } + + [JsonIgnore] + public IModelTypeJv ResponseVariant + { + get + { + if (KnownPrimaryType == KnownPrimaryType.DateTimeRfc1123) + { + return new PrimaryTypeJv(KnownPrimaryType.DateTime); + } + else if (KnownPrimaryType == KnownPrimaryType.UnixTime) + { + return new PrimaryTypeJv(KnownPrimaryType.DateTime); + } + else if (KnownPrimaryType == KnownPrimaryType.Base64Url) + { + return new PrimaryTypeJv(KnownPrimaryType.ByteArray); + } + else if (KnownPrimaryType == KnownPrimaryType.None) + { + return NonNullableVariant; + } + return this; + } + } + + [JsonIgnore] + public IEnumerable Imports + { + get + { + switch (KnownPrimaryType) + { + case KnownPrimaryType.Base64Url: + yield return "com.microsoft.rest.Base64Url"; + break; + case KnownPrimaryType.Date: + yield return "org.joda.time.LocalDate"; + break; + case KnownPrimaryType.DateTime: + yield return "org.joda.time.DateTime"; + break; + case KnownPrimaryType.DateTimeRfc1123: + yield return "com.microsoft.rest.DateTimeRfc1123"; + break; + case KnownPrimaryType.Decimal: + yield return "java.math.BigDecimal"; + break; + case KnownPrimaryType.Stream: + yield return "java.io.InputStream"; + break; + case KnownPrimaryType.TimeSpan: + yield return "org.joda.time.Period"; + break; + case KnownPrimaryType.UnixTime: + yield return "org.joda.time.DateTime"; + yield return "org.joda.time.DateTimeZone"; + break; + case KnownPrimaryType.Uuid: + yield return "java.util.UUID"; + break; + case KnownPrimaryType.Credentials: + yield return "com.microsoft.rest.ServiceClientCredentials"; + break; + } + } + } + + [JsonIgnore] + public IModelTypeJv NonNullableVariant => + new PrimaryTypeJv + { + KnownPrimaryType = KnownPrimaryType, + Format = Format, + WantNullable = false + }; + + [JsonIgnore] + public virtual string ImplementationName + { + get + { + switch (KnownPrimaryType) + { + case KnownPrimaryType.None: + return WantNullable ? "Void" : "void"; + case KnownPrimaryType.Base64Url: + return "Base64Url"; + case KnownPrimaryType.Boolean: + return WantNullable ? "Boolean" : "boolean"; + case KnownPrimaryType.ByteArray: + return "byte[]"; + case KnownPrimaryType.Date: + return "LocalDate"; + case KnownPrimaryType.DateTime: + return "DateTime"; + case KnownPrimaryType.DateTimeRfc1123: + return "DateTimeRfc1123"; + case KnownPrimaryType.Double: + return WantNullable ? "Double" : "double"; + case KnownPrimaryType.Decimal: + return "BigDecimal"; + case KnownPrimaryType.Int: + return WantNullable ? "Integer" : "int"; + case KnownPrimaryType.Long: + return WantNullable ? "Long" : "long"; + case KnownPrimaryType.Stream: + return "InputStream"; + case KnownPrimaryType.String: + return "String"; + case KnownPrimaryType.TimeSpan: + return "Period"; + case KnownPrimaryType.UnixTime: + return WantNullable ? "Long" : "long"; + case KnownPrimaryType.Uuid: + return "UUID"; + case KnownPrimaryType.Object: + return "Object"; + case KnownPrimaryType.Credentials: + return "ServiceClientCredentials"; + } + throw new NotImplementedException($"Primary type {KnownPrimaryType} is not implemented in {GetType().Name}"); + } + } + } +} diff --git a/src/vanilla/Model/PropertyJv.cs b/src/vanilla/Model/PropertyJv.cs new file mode 100644 index 0000000000..bba3475229 --- /dev/null +++ b/src/vanilla/Model/PropertyJv.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using AutoRest.Core.Utilities; +using AutoRest.Core.Model; +using AutoRest.Extensions; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class PropertyJv : Property + { + public PropertyJv() + { + } + + public override string SerializedName + { + get => Extensions.ContainsKey(SwaggerExtensions.FlattenOriginalTypeName) ? base.SerializedName : base.SerializedName?.Replace(".", "\\\\.")?.Replace("\\\\\\\\", "\\\\"); + set => base.SerializedName = value; + } + + + [JsonIgnore] + public bool WantNullable => IsXNullable ?? !IsRequired; + + public override IModelType ModelType + { + get + { + if (base.ModelType == null) + { + return null; + } + return WantNullable + ? base.ModelType + : (base.ModelType as IModelTypeJv).NonNullableVariant; + } + set + { + base.ModelType = value; + } + } + + [JsonIgnore] + public string ClientForm + { + get + { + if (ModelType.IsPrimaryType(KnownPrimaryType.Base64Url)) + { + return string.Format("this.{0}.decodedBytes()", Name, CultureInfo.InvariantCulture); + } + else if (ModelType.IsPrimaryType(KnownPrimaryType.UnixTime)) + { + return "new DateTime(this." + Name + " * 1000L, DateTimeZone.UTC)"; + } + else if (ModelType.Name != ((IModelTypeJv)ModelType).ResponseVariant.Name) + { + return string.Format("this.{0}.{1}()", Name, ((IModelTypeJv)ModelType).ResponseVariant.Name.ToCamelCase(), CultureInfo.InvariantCulture); + } + else + { + return Name; + } + } + } + + [JsonIgnore] + public string FromClientForm + { + get + { + if (ModelType.IsPrimaryType(KnownPrimaryType.Base64Url)) + { + return string.Format("Base64Url.encode({0})", Name, CultureInfo.InvariantCulture); + } + else if (ModelType.IsPrimaryType(KnownPrimaryType.UnixTime)) + { + return string.Format("{0}.toDateTime(DateTimeZone.UTC).getMillis() / 1000", Name, CultureInfo.InvariantCulture); + } + else if (ModelType.Name != ((IModelTypeJv)ModelType).ResponseVariant.Name) + { + return string.Format("new {0}({1})", ModelType.Name, Name, CultureInfo.InvariantCulture); + } + else + { + return Name; + } + } + } + + [JsonIgnore] + public virtual IEnumerable Imports + { + get + { + var imports = new List(ModelType.ImportSafe() + .Where(c => !c.StartsWith( + string.Join( + ".", + Parent?.CodeModel?.Namespace.ToLowerInvariant(), + "models"), + StringComparison.OrdinalIgnoreCase))); + if (ModelType.IsPrimaryType(KnownPrimaryType.DateTimeRfc1123) + || ModelType.IsPrimaryType(KnownPrimaryType.Base64Url)) + { + imports.AddRange(ModelType.ImportSafe()); + imports.AddRange(((IModelTypeJv)ModelType).ResponseVariant.ImportSafe()); + } + return imports; + } + } + } +} diff --git a/src/vanilla/Model/ResponseJv.cs b/src/vanilla/Model/ResponseJv.cs new file mode 100644 index 0000000000..86e0d290a7 --- /dev/null +++ b/src/vanilla/Model/ResponseJv.cs @@ -0,0 +1,381 @@ +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using AutoRest.Core.Utilities; +using AutoRest.Core.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class ResponseJv : Response + { + protected List _interfaceImports = new List(); + protected List _implImports = new List(); + + public ResponseJv() + { + } + + public ResponseJv(IModelTypeJv body, IModelTypeJv headers) + : base(body, headers) + { + } + + #region types + + [JsonIgnore] + public bool NeedsConversion + { + get + { + return + ((BodyWireType == null ? BodyClientType != null : !BodyWireType.StructurallyEquals(BodyClientType)) && BodyClientType.Name != "void") || + (HeaderWireType == null ? HeaderClientType != null : !HeaderWireType.StructurallyEquals(HeaderClientType)); + } + } + + [JsonIgnore] + public virtual IModelTypeJv BodyClientType + { + get + { + return BodyWireType.ResponseVariant; + } + } + + private IModelTypeJv _bodyWireType; + + [JsonIgnore] + public IModelTypeJv BodyWireType + { + get + { + if (_bodyWireType == null) + { + if (Body == null) + { + _bodyWireType = new PrimaryTypeJv(KnownPrimaryType.None); + } + else + { + _bodyWireType = (IModelTypeJv) Body; + } + } + return _bodyWireType; + } + } + + [JsonIgnore] + public IModelTypeJv HeaderClientType + { + get + { + if (Headers == null) + { + return null; + } + else + { + return HeaderWireType.ResponseVariant; + } + } + } + + [JsonIgnore] + public IModelTypeJv HeaderWireType + { + get + { + if (Headers == null) + { + return null; + } + return (IModelTypeJv)Headers; + } + } + + public string ConvertBodyToClientType(string source, string target) + { + return convertToClientType(BodyWireType, source, target); + } + + public string ConvertHeaderToClientType(string source, string target) + { + return convertToClientType(HeaderWireType, source, target); + } + + #endregion + + #region template strings + + [JsonIgnore] + public string ClientResponseType + { + get + { + if (Headers == null) + { + return "ServiceResponse"; + } + else + { + return "ServiceResponseWithHeaders"; + } + } + } + + public string WrapResponse(string responseTypeString) + { + if (Headers == null) + { + return string.Format(CultureInfo.InvariantCulture, "{0}<{1}>", ClientResponseType, responseTypeString); + } + else + { + return string.Format(CultureInfo.InvariantCulture, "{0}<{1}, {2}>", ClientResponseType, responseTypeString, GenericHeaderClientTypeString); + } + } + + [JsonIgnore] + public string ClientResponseTypeString + { + get + { + return WrapResponse(GenericBodyClientTypeString); + } + } + + [JsonIgnore] + public virtual string ObservableClientResponseTypeString + { + get + { + return ClientResponseTypeString; + } + } + + [JsonIgnore] + public virtual string ClientCallbackTypeString + { + get + { + return GenericBodyClientTypeString; + } + } + + [JsonIgnore] + public string WireResponseTypeString + { + get + { + if (Headers == null) + { + return string.Format(CultureInfo.InvariantCulture, "{0}<{1}>", ClientResponseType, GenericBodyWireTypeString); + } + else + { + return string.Format(CultureInfo.InvariantCulture, "{0}<{1}, {2}>", ClientResponseType, GenericBodyWireTypeString, GenericHeaderWireTypeString); + } + } + } + + [JsonIgnore] + public virtual string GenericBodyClientTypeString + { + get + { + var respvariant = BodyWireType.ResponseVariant; + if ((respvariant as PrimaryTypeJv)?.Nullable != false) + { + return respvariant.Name; + } + return BodyWireType.Name; + } + } + + [JsonIgnore] + public string GenericBodyClientTypeStringWrapped + { + get + { + return WrapResponse(GenericBodyClientTypeString); + } + } + + [JsonIgnore] + public virtual string ServiceFutureGenericParameterString + { + get + { + return GenericBodyClientTypeString; + } + } + + [JsonIgnore] + public virtual string ServiceResponseGenericParameterString + { + get + { + return ServiceFutureGenericParameterString; + } + } + + [JsonIgnore] + public string ServiceResponseGenericParameterStringWrapped + { + get + { + return WrapResponse(ServiceResponseGenericParameterString); + } + } + + [JsonIgnore] + public virtual string GenericHeaderClientTypeString + { + get + { + return HeaderClientType.ResponseVariant.Name; + } + } + + [JsonIgnore] + public virtual string GenericBodyWireTypeString + { + get + { + return BodyWireType.Name; + } + } + + [JsonIgnore] + public string GenericBodyWireTypeStringWrapped + { + get + { + return WrapResponse(GenericBodyWireTypeString); + } + } + + [JsonIgnore] + public virtual string GenericHeaderWireTypeString + { + get + { + return HeaderWireType.Name; + } + } + + [JsonIgnore] + public virtual string SequenceElementTypeString + { + get + { + var sequenceType = Body as SequenceTypeJv; + return sequenceType != null ? sequenceType.ElementType.Name.ToString() : "Void"; + } + } + + public string ServiceResponseCreation(string serviceResponse, string body, string response) + { + string format; + if (Headers == null) + { + format = "new {0}({1}, {2}.response())"; + } + else + { + format = "new {0}({1}, {2}.headers(), {2}.response())"; + } + return string.Format(format, serviceResponse, body, response); + } + + #endregion + + [JsonIgnore] + public IEnumerable InterfaceImports + { + get + { + return _interfaceImports.Concat(BodyClientType.ImportSafe()).Concat(HeaderClientType.ImportSafe()); + } + } + + [JsonIgnore] + public IEnumerable ImplImports + { + get + { + var imports = new List(InterfaceImports); + imports.AddRange(BodyWireType.ImportSafe()); + imports.AddRange(HeaderWireType.ImportSafe()); + if (this.NeedsConversion && (Body is SequenceType || Headers is SequenceType)) + { + imports.Add("java.util.ArrayList"); + } + if (this.NeedsConversion && (Body is DictionaryType || Headers is DictionaryType)) + { + imports.Add("java.util.HashMap"); + } + return imports; + } + } + + private string convertToClientType(IModelTypeJv type, string source, string target, int level = 0) + { + if (type == null) + { + return target + " = " + source + ";"; + } + + IndentedStringBuilder builder = new IndentedStringBuilder(); + + var sequenceType = type as SequenceTypeJv; + var dictionaryType = type as DictionaryTypeJv; + + if (sequenceType != null) + { + var elementType = sequenceType.ElementType as IModelTypeJv; + var itemName = string.Format(CultureInfo.InvariantCulture, "item{0}", level == 0 ? "" : level.ToString(CultureInfo.InvariantCulture)); + var itemTarget = string.Format(CultureInfo.InvariantCulture, "value{0}", level == 0 ? "" : level.ToString(CultureInfo.InvariantCulture)); + builder.AppendLine("{0} = new ArrayList<{1}>();", target, elementType.ResponseVariant.Name) + .AppendLine("for ({0} {1} : {2}) {{", elementType.Name, itemName, source) + .Indent().AppendLine("{0} {1};", elementType.ResponseVariant.Name, itemTarget) + .AppendLine(convertToClientType(elementType, itemName, itemTarget, level + 1)) + .AppendLine("{0}.add({1});", target, itemTarget) + .Outdent().Append("}"); + _implImports.Add("java.util.ArrayList"); + return builder.ToString(); + } + else if (dictionaryType != null) + { + var valueType = dictionaryType.ValueType as IModelTypeJv; + var itemName = string.Format(CultureInfo.InvariantCulture, "entry{0}", level == 0 ? "" : level.ToString(CultureInfo.InvariantCulture)); + var itemTarget = string.Format(CultureInfo.InvariantCulture, "value{0}", level == 0 ? "" : level.ToString(CultureInfo.InvariantCulture)); + builder.AppendLine("{0} = new HashMap();", target, valueType.ResponseVariant.Name) + .AppendLine("for (Map.Entry {1} : {2}.entrySet()) {{", valueType.Name, itemName, source) + .Indent().AppendLine("{0} {1};", valueType.ResponseVariant.Name, itemTarget) + .AppendLine(convertToClientType(valueType, itemName + ".getValue()", itemTarget, level + 1)) + .AppendLine("{0}.put({1}.getKey(), {2});", target, itemName, itemTarget) + .Outdent().Append("}"); + _implImports.Add("java.util.HashMap"); + return builder.ToString(); + } + else if (type.IsPrimaryType(KnownPrimaryType.DateTimeRfc1123)) + { + return target + " = " + source + ".dateTime();"; + } + else if (type.IsPrimaryType(KnownPrimaryType.UnixTime)) + { + return target + " = new DateTime(" + source + " * 1000L, DateTimeZone.UTC);"; + } + else if (type.IsPrimaryType(KnownPrimaryType.Base64Url)) + { + return target + " = " + source + ".decodedBytes();"; + } + else + { + return target + " = " + source + ";"; + } + } + } +} diff --git a/src/vanilla/Model/SequenceTypeJv.cs b/src/vanilla/Model/SequenceTypeJv.cs new file mode 100644 index 0000000000..03e4e6d7b7 --- /dev/null +++ b/src/vanilla/Model/SequenceTypeJv.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using System.Linq; +using AutoRest.Core.Utilities; +using AutoRest.Core.Model; +using Newtonsoft.Json; + +namespace AutoRest.Java.Model +{ + public class SequenceTypeJv : SequenceType, IModelTypeJv + { + public SequenceTypeJv() + { + Name.OnGet += v => $"List<{ElementType.Name}>"; + } + + [JsonIgnore] + public IModelTypeJv ResponseVariant + { + get + { + var respvariant = (ElementType as IModelTypeJv).ResponseVariant; + if (respvariant != ElementType && (respvariant as PrimaryTypeJv)?.Nullable != false) + { + return new SequenceTypeJv { ElementType = respvariant }; + } + return this; + } + } + + [JsonIgnore] + public IModelTypeJv ParameterVariant + { + get + { + var respvariant = (ElementType as IModelTypeJv).ParameterVariant; + if (respvariant != ElementType && (respvariant as PrimaryTypeJv)?.Nullable != false) + { + return new SequenceTypeJv { ElementType = respvariant }; + } + return this; + } + } + + [JsonIgnore] + public IEnumerable Imports + { + get + { + List imports = new List { "java.util.List" }; + return imports.Concat(((IModelTypeJv) this.ElementType).Imports); + } + } + + [JsonIgnore] + public IModelTypeJv NonNullableVariant => this; + } +} diff --git a/src/vanilla/PluginJv.cs b/src/vanilla/PluginJv.cs new file mode 100644 index 0000000000..153d0f5911 --- /dev/null +++ b/src/vanilla/PluginJv.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using AutoRest.Core; +using AutoRest.Core.Extensibility; +using AutoRest.Core.Model; +using AutoRest.Core.Utilities; +using AutoRest.Java.Model; +using static AutoRest.Core.Utilities.DependencyInjection; + +namespace AutoRest.Java +{ + public sealed class PluginJv : Plugin + { + public PluginJv() + { + Context = new Context + { + // inherit base settings + Context, + + // set code model implementations our own implementations + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory(), + new Factory() + }; + } + } +} \ No newline at end of file diff --git a/src/vanilla/ScopeProvider.cs b/src/vanilla/ScopeProvider.cs new file mode 100644 index 0000000000..dbfea4ba53 --- /dev/null +++ b/src/vanilla/ScopeProvider.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; + +namespace AutoRest.Java +{ + public class ScopeProvider : IScopeProvider + { + // HashSet to track variable names that have been used in a scope. + private readonly HashSet _variables = new HashSet(); + + /// + /// Get a variable name that is unique in this scope. + /// + /// Prefix to use in creating variable. + /// A variable name unique in this scope. + public string GetVariableName(string prefix) + { + if (_variables.Add(prefix)) + { + return prefix; + } + + return GetAlternateVariableName(prefix, 1); + } + + private string GetAlternateVariableName(string prefix, int suffix) + { + string name = prefix + suffix; + if (_variables.Add(name)) + { + return name; + } + + return GetAlternateVariableName(prefix, ++suffix); + } + } +} \ No newline at end of file diff --git a/src/vanilla/Templates/EnumTemplate.cshtml b/src/vanilla/Templates/EnumTemplate.cshtml new file mode 100644 index 0000000000..5fad821fb4 --- /dev/null +++ b/src/vanilla/Templates/EnumTemplate.cshtml @@ -0,0 +1,128 @@ +@using System.Linq +@using AutoRest.Java +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower())@Model.ModelsPackage; +@EmptyLine +@if (!Model.ModelAsString) +{ + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +@EmptyLine + +} +else +{ + +import com.fasterxml.jackson.annotation.JsonValue; +@EmptyLine + +} + +/** + * Defines values for @(Model.Name). + */ +@if (!Model.ModelAsString) +{ + +public enum @(Model.Name) { +@for (int i = 0; i < Model.Values.Count - 1; i++) +{ +@: /** Enum value @(Model.Values[i].SerializedName). */ +@: @(Model.Values[i].MemberName)("@(Model.Values[i].SerializedName)"), +@EmptyLine +} + /** Enum value @(Model.Values.Last().SerializedName). */ + @(Model.Values.Last().MemberName)("@(Model.Values.Last().SerializedName)"); + @EmptyLine + + /** The actual serialized value for a @(Model.Name) instance. */ + private String value; + @EmptyLine + + @(Model.Name)(String value) { + this.value = value; + } + @EmptyLine + + /** + * Parses a serialized value to a @(Model.Name) instance. + * + * @@param value the serialized value to parse. + * @@return the parsed @(Model.Name) object, or null if unable to parse. + */ + @@JsonCreator + public static @Model.Name fromString(String value) { + @(Model.Name)[] items = @(Model.Name).values(); + for (@(Model.Name) item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + @EmptyLine + + @@JsonValue + @@Override + public String toString() { + return this.value; + } +} + +} +else +{ + +public final class @(Model.Name) { +@for (int i = 0; i < Model.Values.Count; i++) +{ +@: /** Static value @(Model.Values[i].SerializedName) for @(Model.Name). */ +@: public static final @(Model.Name) @(Model.Values[i].MemberName) = new @(Model.Name)("@(Model.Values[i].SerializedName)"); +@EmptyLine +} + private String value; +@EmptyLine + /** + * Creates a custom value for @(Model.Name). + * @@param value the custom value + */ + public @(Model.Name)(String value) { + this.value = value; + } +@EmptyLine + @@JsonValue + @@Override + public String toString() { + return value; + } +@EmptyLine + @@Override + public int hashCode() { + return value.hashCode(); + } +@EmptyLine + @@Override + public boolean equals(Object obj) { + if (!(obj instanceof @(Model.Name))) { + return false; + } + if (obj == this) { + return true; + } + + @(Model.Name) rhs = (@(Model.Name)) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } +} + +} diff --git a/src/vanilla/Templates/ExceptionTemplate.cshtml b/src/vanilla/Templates/ExceptionTemplate.cshtml new file mode 100644 index 0000000000..bdeb5fc503 --- /dev/null +++ b/src/vanilla/Templates/ExceptionTemplate.cshtml @@ -0,0 +1,47 @@ +@using System.Linq +@using System.Collections.Generic +@using AutoRest.Java +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower())@Model.ModelsPackage; +@EmptyLine + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; +@EmptyLine + +/** +@WrapComment(" * ", "Exception thrown for an invalid response with " + Model.Name + " information.") + */ +public class @Model.ExceptionTypeDefinitionName extends RestException { + /** + * Initializes a new instance of the @(Model.ExceptionTypeDefinitionName) class. + * + * @@param message the exception message or the response content if a message is not available + * @@param response the HTTP response + */ + public @(Model.ExceptionTypeDefinitionName)(final String message, final Response response) { + super(message, response); + } +@EmptyLine + /** + * Initializes a new instance of the @(Model.ExceptionTypeDefinitionName) class. + * + * @@param message the exception message or the response content if a message is not available + * @@param response the HTTP response + * @@param body the deserialized response body + */ + public @(Model.ExceptionTypeDefinitionName)(final String message, final Response response, final @Model.Name body) { + super(message, response, body); + } +@EmptyLine + @@Override + public @Model.Name body() { + return (@Model.Name) super.body(); + } +} \ No newline at end of file diff --git a/src/vanilla/Templates/MethodGroupInterfaceTemplate.cshtml b/src/vanilla/Templates/MethodGroupInterfaceTemplate.cshtml new file mode 100644 index 0000000000..77e9c12a47 --- /dev/null +++ b/src/vanilla/Templates/MethodGroupInterfaceTemplate.cshtml @@ -0,0 +1,30 @@ +@using System +@using AutoRest.Java.vanilla.Templates +@using System.Linq; +@using AutoRest.Java +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()); +@EmptyLine +@foreach (var importClass in Model.InterfaceImports) +{ +@:import @importClass; +} +@EmptyLine + +/** + * An instance of this class provides access to all the operations defined + * in @(Model.TypeName). + */ +public interface @Model.TypeName { + @foreach (MethodJv method in Model.Methods) + { + @:@Include(new MethodInterfaceTemplate(), method) + @EmptyLine + } +} diff --git a/src/vanilla/Templates/MethodGroupRetrofitTemplate.cshtml b/src/vanilla/Templates/MethodGroupRetrofitTemplate.cshtml new file mode 100644 index 0000000000..922976bb26 --- /dev/null +++ b/src/vanilla/Templates/MethodGroupRetrofitTemplate.cshtml @@ -0,0 +1,36 @@ +@using System.Linq; +@using AutoRest.Core.Model +@using AutoRest.Core.Utilities +@using AutoRest.Java.Model; +@inherits AutoRest.Core.Template +/** + * The interface defining all the services for @Model.TypeName to be + * used by Retrofit to perform actually REST calls. + */ +interface @Model.MethodGroupServiceType { +@foreach (MethodJv method in Model.Methods) +{ +if (method.RequestContentType == "multipart/form-data" || method.RequestContentType == "application/x-www-form-urlencoded") +{ +@: @@Multipart +} +else +{ +@: @@Headers({ "Content-Type: @method.RequestContentType", "x-ms-logging-context: @Model.MethodGroupFullType @method.Name" }) +} +if (method.HttpMethod == HttpMethod.Delete) +{ +@: @@HTTP(path = "@(method.Url.TrimStart('/'))", method = "DELETE", hasBody = true) +} +else +{ +@: @@@(method.HttpMethod.ToString().ToUpper())("@(method.Url.TrimStart('/'))") +} +if (method.ReturnType.Body.IsPrimaryType(KnownPrimaryType.Stream)) +{ +@: @@Streaming +} +@: Observable> @(method.Name)(@method.MethodParameterApiDeclaration); +@EmptyLine +} +} \ No newline at end of file diff --git a/src/vanilla/Templates/MethodGroupTemplate.cshtml b/src/vanilla/Templates/MethodGroupTemplate.cshtml new file mode 100644 index 0000000000..b0aaaf926e --- /dev/null +++ b/src/vanilla/Templates/MethodGroupTemplate.cshtml @@ -0,0 +1,51 @@ +@using System +@using AutoRest.Java.vanilla.Templates +@using System.Linq; +@using AutoRest.Java +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()).@(Model.ImplPackage); +@EmptyLine +@foreach (var importClass in Model.ImplImports) +{ +@:import @importClass; +} +@EmptyLine + +/** + * An instance of this class provides access to all the operations defined + * in @(Model.TypeName). + */ +public class @(Model.MethodGroupImplType)@(Model.ParentDeclaration) { + /** The Retrofit service to perform REST calls. */ + private @Model.MethodGroupServiceType service; + /** The service client containing this operation class. */ + private @(Model.ServiceClientType) client; + @EmptyLine + /** + * Initializes an instance of @(Model.TypeName). + * + * @@param retrofit the Retrofit instance built from a Retrofit Builder. + * @@param client the instance of the service client containing this operation class. + */ + public @(Model.MethodGroupImplType)(Retrofit retrofit, @(Model.ServiceClientType) client) { + this.service = retrofit.create(@(Model.MethodGroupServiceType).class); + this.client = client; + } + @EmptyLine + + @Include(new MethodGroupRetrofitTemplate(), Model) + + @EmptyLine + + @foreach (MethodJv method in Model.Methods) + { + @:@(Include(new MethodTemplate(), method)) + @EmptyLine + } +} diff --git a/src/vanilla/Templates/MethodInterfaceTemplate.cshtml b/src/vanilla/Templates/MethodInterfaceTemplate.cshtml new file mode 100644 index 0000000000..90267f6e83 --- /dev/null +++ b/src/vanilla/Templates/MethodInterfaceTemplate.cshtml @@ -0,0 +1,200 @@ +@using System.Linq; +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +@if (Model.LocalParameters.Any(p => !p.IsConstant && !p.IsRequired)) +{ + +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@throws @Model.OperationExceptionTypeString thrown if the request is rejected by server + * @@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent +@if (Model.ReturnTypeResponseName.Else("void") != "void") +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object if successful. +} + */ +@Model.ReturnTypeResponseName @(Model.Name)(@Model.MethodRequiredParameterDeclaration); +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment()) +} +@Model.CallbackDocumentation + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the {@@link ServiceFuture} object + */ +ServiceFuture<@Model.ReturnTypeJv.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclarationWithCallback); +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @((param.Documentation.IsNullOrEmpty() ? "the " + param.ModelType.Name + " value" : param.Documentation.ToString()).EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnTypeResponseName.Else("void") != "void") +{ +@: * @@return the observable to the @Model.ReturnTypeResponseName.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +Observable<@Model.ReturnTypeJv.ServiceResponseGenericParameterString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclaration); +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @((param.Documentation.IsNullOrEmpty() ? "the " + param.ModelType.Name + " value" : param.Documentation.ToString()).EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnTypeResponseName.Else("void") != "void") +{ +@: * @@return the observable to the @Model.ReturnTypeResponseName.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +Observable<@Model.ReturnTypeJv.ServiceResponseGenericParameterStringWrapped> @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterDeclaration); + +} +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@throws @Model.OperationExceptionTypeString thrown if the request is rejected by server + * @@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent +@if (Model.ReturnTypeResponseName.Else("void") != "void") +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object if successful. +} + */ +@Model.ReturnTypeResponseName @(Model.Name)(@Model.MethodParameterDeclaration); +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment()) +} +@Model.CallbackDocumentation + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the {@@link ServiceFuture} object + */ +ServiceFuture<@Model.ReturnTypeJv.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodParameterDeclarationWithCallback); +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @((param.Documentation.IsNullOrEmpty() ? "the " + param.ModelType.Name + " value" : param.Documentation.ToString()).EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnTypeResponseName.Else("void") != "void") +{ +@: * @@return the observable to the @Model.ReturnTypeResponseName.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +Observable<@Model.ReturnTypeJv.ServiceResponseGenericParameterString> @(Model.Name)Async(@Model.MethodParameterDeclaration); +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @((param.Documentation.IsNullOrEmpty() ? "the " + param.ModelType.Name + " value" : param.Documentation.ToString()).EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnTypeResponseName.Else("void") != "void") +{ +@: * @@return the observable to the @Model.ReturnTypeResponseName.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +Observable<@Model.ReturnTypeJv.ServiceResponseGenericParameterStringWrapped> @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterDeclaration); \ No newline at end of file diff --git a/src/vanilla/Templates/MethodTemplate.cshtml b/src/vanilla/Templates/MethodTemplate.cshtml new file mode 100644 index 0000000000..c576e026d4 --- /dev/null +++ b/src/vanilla/Templates/MethodTemplate.cshtml @@ -0,0 +1,352 @@ +@using System.Linq; +@using AutoRest.Core.Model +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +@if (Model.LocalParameters.Any(p => !p.IsConstant && !p.IsRequired)) +{ + +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@throws @Model.OperationExceptionTypeString thrown if the request is rejected by server + * @@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent +@if (Model.ReturnType.Body != null) +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object if successful. +} + */ +public @Model.ReturnTypeResponseName @(Model.Name)(@Model.MethodRequiredParameterDeclaration) { +@if (@Model.ReturnTypeResponseName == "void") +{ +@: @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation).toBlocking().single().body(); +} +else +{ +@: return @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation).toBlocking().single().body(); +} +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@Model.CallbackDocumentation + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the {@@link ServiceFuture} object + */ +public ServiceFuture<@Model.ReturnTypeJv.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclarationWithCallback) { + return ServiceFuture.@(Model.ServiceFutureFactoryMethod)(@(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation), serviceCallback); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeJv.GenericBodyClientTypeString.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJv.GenericBodyClientTypeString> @(Model.Name)Async(@Model.MethodRequiredParameterDeclaration) { + return @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterInvocation).map(new Func1<@Model.ReturnTypeJv.ClientResponseTypeString, @Model.ReturnTypeJv.GenericBodyClientTypeString>() { + @@Override + public @Model.ReturnTypeJv.GenericBodyClientTypeString call(@Model.ReturnTypeJv.ClientResponseTypeString response) { + return response.body(); + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant && p.IsRequired)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeJv.GenericBodyClientTypeString.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJv.ClientResponseTypeString> @(Model.Name)WithServiceResponseAsync(@Model.MethodRequiredParameterDeclaration) { +@foreach (var param in Model.RequiredNullableParameters) +{ +@: if (@param.Name == null) { +@: throw new IllegalArgumentException("Parameter @param.Name is required and cannot be null."); +@: } +} +@foreach (var param in Model.ParametersToValidate.Where(p => p.IsRequired)) +{ +@: Validator.validate(@(param.Name)); +} +@foreach (ParameterJv parameter in Model.LocalParameters) +{ + if (!parameter.IsRequired) + { +@: final @(parameter.ClientType.Name) @(parameter.Name) = @(parameter.ClientType.GetDefaultValue(Model) ?? "null"); + } + if (parameter.IsConstant) + { +@: final @(parameter.ClientType.Name) @(parameter.Name) = @(parameter.DefaultValue ?? "null"); + + } +} + @Model.BuildInputMappings(true) + +@if (Model.IsParameterizedHost) +{ +@: String parameterizedHost = Joiner.on(", ").join(@Model.HostParameterReplacementArgs); +} + @Model.ParameterConversion + return service.@(Model.Name)(@Model.MethodRequiredParameterApiInvocation) + .flatMap(new Func1, Observable<@(Model.ReturnTypeJv.ClientResponseTypeString)>>() { + @@Override + public Observable<@(Model.ReturnTypeJv.ClientResponseTypeString)> call(Response<@Model.CallType> response) { + try { + @Model.ClientResponse() + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); +} +@EmptyLine + +} +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@throws @Model.OperationExceptionTypeString thrown if the request is rejected by server + * @@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent +@if (Model.ReturnType.Body != null) +{ +@: * @@return the @Model.ReturnTypeResponseName.EscapeXmlComment() object if successful. +} + */ +public @Model.ReturnTypeResponseName @(Model.Name)(@Model.MethodParameterDeclaration) { +@if (@Model.ReturnTypeResponseName == "void") +{ +@: @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation).toBlocking().single().body(); +} +else +{ +@: return @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation).toBlocking().single().body(); +} +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} +@Model.CallbackDocumentation + * @@throws IllegalArgumentException thrown if parameters fail the validation + * @@return the {@@link ServiceFuture} object + */ +public ServiceFuture<@Model.ReturnTypeJv.ServiceFutureGenericParameterString> @(Model.Name)Async(@Model.MethodParameterDeclarationWithCallback) { + return ServiceFuture.@(Model.ServiceFutureFactoryMethod)(@(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation), serviceCallback); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeJv.GenericBodyClientTypeString.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJv.GenericBodyClientTypeString> @(Model.Name)Async(@Model.MethodParameterDeclaration) { + return @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterInvocation).map(new Func1<@Model.ReturnTypeJv.ClientResponseTypeString, @Model.ReturnTypeJv.GenericBodyClientTypeString>() { + @@Override + public @Model.ReturnTypeJv.GenericBodyClientTypeString call(@Model.ReturnTypeJv.ClientResponseTypeString response) { + return response.body(); + } + }); +} +@EmptyLine +/** +@if (!string.IsNullOrEmpty(Model.Summary)) +{ +@: * @Model.Summary.EscapeXmlComment().Period() +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.EscapeXmlComment().Period() +} + * +@foreach (var param in Model.LocalParameters.Where(p => !p.IsConstant)) +{ +@: * @@param @param.Name @(param.Documentation.Else("the " + param.ModelType.Name + " value").EscapeXmlComment().Trim()) +} + * @@throws IllegalArgumentException thrown if parameters fail the validation +@if (Model.ReturnType.Body != null) +{ +@: * @@return the observable to the @Model.ReturnTypeJv.GenericBodyClientTypeString.EscapeXmlComment() object +} +else +{ +@: * @@return the {@@link @Model.ReturnTypeJv.ClientResponseType} object if successful. +} + */ +public Observable<@Model.ReturnTypeJv.ClientResponseTypeString> @(Model.Name)WithServiceResponseAsync(@Model.MethodParameterDeclaration) { +@foreach (var param in Model.RequiredNullableParameters) +{ +@: if (@param.Name == null) { +@: throw new IllegalArgumentException("Parameter @param.Name is required and cannot be null."); +@: } +} +@foreach (var param in Model.ParametersToValidate) +{ +@: Validator.validate(@(param.Name)); +} +@foreach (ParameterJv parameter in Model.LocalParameters) +{ + if (parameter.IsConstant) + { +@: final @(parameter.ModelType.Name) @(parameter.Name) = @(parameter.DefaultValue ?? "null"); + } +} + @Model.BuildInputMappings() + +@if (Model.IsParameterizedHost) +{ +@: String parameterizedHost = Joiner.on(", ").join(@Model.HostParameterReplacementArgs); +} + @Model.ParameterConversion + return service.@(Model.Name)(@Model.MethodParameterApiInvocation) + .flatMap(new Func1, Observable<@(Model.ReturnTypeJv.ClientResponseTypeString)>>() { + @@Override + public Observable<@(Model.ReturnTypeJv.ClientResponseTypeString)> call(Response<@Model.CallType> response) { + try { + @Model.ClientResponse() + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); +} +@EmptyLine +private @Model.ReturnTypeJv.WireResponseTypeString @(Model.Name)Delegate(Response<@Model.CallType> response) throws @Model.ExceptionString { + return @(Model.ClientReference).restClient().responseBuilderFactory().<@Model.ReturnTypeJv.GenericBodyWireTypeString, @Model.OperationExceptionTypeString>newInstance(@(Model.ClientReference).serializerAdapter()) +@foreach (var response in Model.Responses) +{ + + @:.register(@((int)response.Key), new TypeToken<@((response.Value as ResponseJv).GenericBodyWireTypeString)>() { }.getType()) +} +@if (Model.DefaultResponse.Body != null) +{ + @:.registerError(@(Model.OperationExceptionTypeString).class) +} +@if (Model.HttpMethod == HttpMethod.Head) +{ + if (Model.ReturnType.Headers != null) + { + @:.buildEmptyWithHeaders(response, @(Model.ReturnType.Headers.Name).class); + } + else + { + @:.buildEmpty(response); + } +} +else +{ + if (Model.ReturnType.Headers != null) + { + @:.buildWithHeaders(response, @(Model.ReturnType.Headers.Name).class); + } + else + { + @:.build(response); + } +} +} \ No newline at end of file diff --git a/src/vanilla/Templates/ModelTemplate.cshtml b/src/vanilla/Templates/ModelTemplate.cshtml new file mode 100644 index 0000000000..7e62481953 --- /dev/null +++ b/src/vanilla/Templates/ModelTemplate.cshtml @@ -0,0 +1,146 @@ +@using System.Linq +@using System.Collections.Generic +@using AutoRest.Core.Model +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower())@Model.ModelsPackage; +@EmptyLine + +@foreach (var importClass in Model.ImportList) +{ +@:import @importClass; +} +@EmptyLine + +/** +@if (string.IsNullOrEmpty(Model.Summary) && string.IsNullOrEmpty(Model.Documentation)) +{ +@:@WrapComment(" * ", "The " + Model.Name + " model.") +} +else +{ +@:@WrapComment(" * ", Model.Summary.EscapeXmlComment().Period()) +@:@WrapComment(" * ", Model.Documentation.EscapeXmlComment().Period()) +} + */ +@if (Model.BaseIsPolymorphic) +{ +@:@@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "@(Model.BasePolymorphicDiscriminator)") +@:@@JsonTypeName("@(Model.SerializedName)") +var types = Model.SubTypes.ToList(); +if (types.Any()) +{ +@:@@JsonSubTypes({ +for (int i = 0; i < types.Count - 1; i++) +{ +var type = types[i]; +@: @@JsonSubTypes.Type(name = "@(type.SerializedName)", value = @(type.Name).class), +} +@: @@JsonSubTypes.Type(name = "@(types.Last().SerializedName)", value = @(types.Last().Name).class) +@:}) +} +} +@if (Model.NeedsFlatten) +{ +@:@@JsonFlatten +} +public class @(Model.Name)@(Model.BaseModelType != null ? " extends " + Model.BaseModelType.Name.ToPascalCase() : "") { +@foreach (PropertyJv property in Model.Properties) +{ +@: /** +if (string.IsNullOrEmpty(property.Summary) && string.IsNullOrEmpty(property.Documentation)) +{ +@: @WrapComment(" * ", "The " + property.Name + " property.") +} +else +{ +@: @WrapComment(" * ", property.Summary.EscapeXmlComment().Period()) +@: @WrapComment(" * ", property.Documentation.EscapeXmlComment().Period()) +} +@: */ +var jsonSetting = property.GetJsonProperty(); +if (!jsonSetting.IsNullOrEmpty()) +{ +@: @@JsonProperty(@(jsonSetting)) +} +@: private @property.ModelType.Name @property.Name; +@EmptyLine +} + +@if (Model.Properties.Any(p => p.IsConstant)) +{ + + /** + * Creates an instance of @(Model.Name) class. + */ + public @(Model.Name)() { + @foreach (var property in Model.Properties.Where(p => p.IsConstant)) + { + if (property.ModelType is CompositeType) { + @:@(property.Name) = new @(property.ModelType.Name)(); + } + else + { + @:@(property.Name) = @(property.DefaultValue); + } + } + } +@EmptyLine + +} + +@foreach (PropertyJv property in Model.Properties) +{ +@: /** +@: * Get the @property.Name value. +@: * +@: * @@return the @property.Name value +@: */ +@: public @(((IModelTypeJv)property.ModelType).ResponseVariant.Name) @(property.Name.ToCamelCase())() { +if (property.ModelType.Name != ((IModelTypeJv) property.ModelType).ResponseVariant.Name) +{ +@: if (this.@(property.Name) == null) { +@: return null; +@: } +@: return @(property.ClientForm); +} +else +{ +@: return this.@(property.Name); +} +@: } +@EmptyLine +if (!property.IsReadOnly) +{ +@: /** +@: * Set the @property.Name value. +@: * +@: * @@param @property.Name the @property.Name value to set +@: * @@return the @(Model.Name) object itself. +@: */ +@: public @(Model.Name) with@(property.Name.ToPascalCase())(@(((IModelTypeJv)property.ModelType).ResponseVariant.Name) @property.Name) { +if (property.ModelType.Name != ((IModelTypeJv)property.ModelType).ResponseVariant.Name) +{ +@: if (@property.Name == null) { +@: this.@(property.Name) = null; +@: } else { +@: this.@(property.Name) = @(property.FromClientForm); +@: } +} +else +{ +@: this.@(property.Name) = @property.Name; +} +@: return this; +@: } +@EmptyLine +} +} +} \ No newline at end of file diff --git a/src/vanilla/Templates/PackageInfoTemplate.cshtml b/src/vanilla/Templates/PackageInfoTemplate.cshtml new file mode 100644 index 0000000000..7702d7750f --- /dev/null +++ b/src/vanilla/Templates/PackageInfoTemplate.cshtml @@ -0,0 +1,29 @@ +@using System.Linq +@using AutoRest.Java +@inherits AutoRest.Core.Template +@Header("// ").TrimMultilineHeader() +@EmptyLine + +/** +@if (string.IsNullOrEmpty(Model.SubPackage)) +{ +@: * This package contains the classes for @(Model.Title). +} +else +{ +@: * This package contains the @Model.SubPackage classes for @(Model.Title). +} +@if (!string.IsNullOrEmpty(Model.Description)) +{ +@: * @Model.Description.Period() +} + */ + +@if (string.IsNullOrEmpty(Model.SubPackage)) +{ +@:package @(Settings.Namespace.ToLower()); +} +else +{ +@:package @(Settings.Namespace.ToLower()).@(Model.SubPackage); +} \ No newline at end of file diff --git a/src/vanilla/Templates/ServiceClientInterfaceTemplate.cshtml b/src/vanilla/Templates/ServiceClientInterfaceTemplate.cshtml new file mode 100644 index 0000000000..8fd42b7830 --- /dev/null +++ b/src/vanilla/Templates/ServiceClientInterfaceTemplate.cshtml @@ -0,0 +1,78 @@ +@using System +@using AutoRest.Java.vanilla.Templates +@using System.Linq +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()); +@EmptyLine +@foreach (var importClass in Model.InterfaceImports) +{ +@:import @importClass; +} +@EmptyLine + +/** + * The interface for @Model.Name class. + */ +public interface @Model.Name { + /** + * Gets the REST client. + * + * @@return the {@@link RestClient} object. + */ + RestClient restClient(); +@EmptyLine + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "@Model.BaseUrl"; +@foreach (var property in Model.Properties) +{ +@EmptyLine +@: /** +@: * Gets @(property.Documentation). +@: * +@: * @@return the @(property.Name) value. +@: */ +@: @property.ModelType.ServiceResponseVariant().Name @(property.Name.ToCamelCase())(); +if(!property.IsReadOnly) +{ +@EmptyLine +@: /** +@: * Sets @(property.Documentation). +@: * +@: * @@param @(property.Name.ToCamelCase()) the @(property.Name) value. +@: * @@return the service client itself +@: */ +@: @(Model.Name) with@(property.Name.ToPascalCase())(@(property.ModelType.ServiceResponseVariant().Name) @(property.Name.ToCamelCase())); +} +} + +@foreach (var operation in Model.AllOperations) +{ +@EmptyLine +@: /** +@: * Gets the @(operation.TypeName) object to access its operations. +@: * @@return the @(operation.TypeName) object. +@: */ +@: @(operation.TypeName) @(operation.Name)(); +} +@EmptyLine +@if (Model.RootMethods.Any()) +{ + + @foreach (MethodJv method in Model.RootMethods) + { + @:@Include(new MethodInterfaceTemplate(), method) + @EmptyLine + } + +} +} diff --git a/src/vanilla/Templates/ServiceClientRetrofitTemplate.cshtml b/src/vanilla/Templates/ServiceClientRetrofitTemplate.cshtml new file mode 100644 index 0000000000..e9df6bc454 --- /dev/null +++ b/src/vanilla/Templates/ServiceClientRetrofitTemplate.cshtml @@ -0,0 +1,36 @@ +@using System.Linq; +@using AutoRest.Core.Model +@using AutoRest.Core.Utilities +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +/** + * The interface defining all the services for @Model.Name to be + * used by Retrofit to perform actually REST calls. + */ +interface @Model.ServiceClientServiceType { +@foreach (MethodJv method in Model.Methods) +{ +if (method.RequestContentType == "multipart/form-data" || method.RequestContentType == "application/x-www-form-urlencoded") +{ +@: @@Multipart +} +else +{ +@: @@Headers({ "Content-Type: @method.RequestContentType", "x-ms-logging-context: @Model.FullyQualifiedDomainName @method.Name" }) +} +if (method.HttpMethod == HttpMethod.Delete) +{ +@: @@HTTP(path = "@(method.Url.TrimStart('/'))", method = "DELETE", hasBody = true) +} +else +{ +@: @@@(method.HttpMethod.ToString().ToUpper())("@(method.Url.TrimStart('/'))") +} +if (method.ReturnType.Body.IsPrimaryType(KnownPrimaryType.Stream)) +{ +@: @@Streaming +} +@: Observable> @(method.Name)(@method.MethodParameterApiDeclaration); +@EmptyLine +} +} \ No newline at end of file diff --git a/src/vanilla/Templates/ServiceClientTemplate.cshtml b/src/vanilla/Templates/ServiceClientTemplate.cshtml new file mode 100644 index 0000000000..63d8b09f7c --- /dev/null +++ b/src/vanilla/Templates/ServiceClientTemplate.cshtml @@ -0,0 +1,170 @@ +@using System +@using AutoRest.Java.vanilla.Templates +@using System.Linq +@using AutoRest.Core.Utilities +@using AutoRest.Java +@using AutoRest.Java.Model +@inherits AutoRest.Core.Template +/** +@Header(" * ").TrimMultilineHeader() + */ +@EmptyLine + +package @(Settings.Namespace.ToLower()).@(Model.ImplPackage); + +@EmptyLine +@foreach (var importClass in Model.ImplImports) +{ +@:import @importClass; +} +@EmptyLine + +/** + * Initializes a new instance of the @Model.Name class. + */ +public class @(Model.Name)Impl extends ServiceClient implements @Model.Name { +@if (Model.RootMethods.Any()) +{ +@: /** +@: * The Retrofit service to perform REST calls. +@: */ +@: private @Model.ServiceClientServiceType service; +} +@foreach (var property in Model.Properties) +{ +@EmptyLine +@: /** @(property.Documentation.ToString().Period()) */ +@: private @(property.ModelType.ServiceResponseVariant().Name) @(property.Name.ToCamelCase()); +@EmptyLine +@: /** +@: * Gets @(property.Documentation.ToString().Period()) +@: * +@: * @@return the @(property.Name) value. +@: */ +@: public @(property.ModelType.ServiceResponseVariant().Name) @(property.Name.ToCamelCase())() { +@: return this.@(property.Name.ToCamelCase()); +@: } +if(!property.IsReadOnly) +{ +@EmptyLine +@: /** +@: * Sets @(property.Documentation.ToString().Period()) +@: * +@: * @@param @(property.Name.ToCamelCase()) the @(property.Name) value. +@: * @@return the service client itself +@: */ +@: public @(Model.Name)Impl with@(property.Name.ToPascalCase())(@(property.ModelType.ServiceResponseVariant().Name) @(property.Name.ToCamelCase())) { +@: this.@(property.Name.ToCamelCase()) = @(property.Name.ToCamelCase()); +@: return this; +@: } +} +} + +@foreach (var operation in Model.AllOperations) +{ +@EmptyLine +@: /** +@: * The @(operation.TypeName) object to access its operations. +@: */ +@: private @(operation.TypeName) @(operation.Name); +@EmptyLine +@: /** +@: * Gets the @(operation.TypeName) object to access its operations. +@: * @@return the @(operation.TypeName) object. +@: */ +@: public @(operation.TypeName) @(operation.Name)() { +@: return this.@(operation.Name); +@: } +} +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + */ + public @(Model.Name)Impl() { + this("@Model.BaseUrl"); + } +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param baseUrl the base URL of the host + */ + @(Model.IsCustomBaseUri ? "private" : "public") @(Model.Name)Impl(String baseUrl) { + super(baseUrl); + initialize(); + } + +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @@param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public @(Model.Name)Impl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("@Model.BaseUrl", clientBuilder, restBuilder); + initialize(); + } + +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param baseUrl the base URL of the host + * @@param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @@param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + @(Model.IsCustomBaseUri ? "private" : "public") @(Model.Name)Impl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } +@EmptyLine + /** + * Initializes an instance of @(Model.Name) client. + * + * @@param restClient the REST client containing pre-configured settings + */ + public @(Model.Name)Impl(RestClient restClient) { + super(restClient); + initialize(); + } + +@EmptyLine + private void initialize() { +@foreach (var property in Model.Properties.Where(p => p.DefaultValue != null)) +{ +@: this.@(property.Name) = @(property.DefaultValue); +} +@foreach (var operation in Model.AllOperations) +{ +@: this.@(operation.Name) = new @(operation.TypeName)Impl(retrofit(), this); +} +@if (Model.RootMethods.Any()) +{ +@: initializeService(); +} + } + +@if (Model.RootMethods.Any()) +{ +@EmptyLine + + private void initializeService() { + service = retrofit().create(@(Model.ServiceClientServiceType).class); + } + +@EmptyLine +@if (Model.RootMethods.Any()) +{ +@: @Include(new ServiceClientRetrofitTemplate(), Model) +@EmptyLine +} + +@foreach (MethodJv method in Model.RootMethods) +{ + @:@(Include(new MethodTemplate(), method)) + @EmptyLine +} + +} +} diff --git a/src/vanilla/TransformerJv.cs b/src/vanilla/TransformerJv.cs new file mode 100644 index 0000000000..ed031eb594 --- /dev/null +++ b/src/vanilla/TransformerJv.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using AutoRest.Core; +using AutoRest.Core.Model; +using AutoRest.Java.Model; +using AutoRest.Extensions; +using static AutoRest.Core.Utilities.DependencyInjection; + +namespace AutoRest.Java +{ + public class TransformerJv : CodeModelTransformer + { + public override CodeModelJv TransformCodeModel(CodeModel cs) + { + var codeModel = cs as CodeModelJv; + // we're guaranteed to be in our language-specific context here. + + // todo: these should be turned into individual transformers + SwaggerExtensions.NormalizeClientModel(codeModel); + + return codeModel; + } + } +} \ No newline at end of file diff --git a/test/azure/pom.xml b/test/azure/pom.xml new file mode 100644 index 0000000000..a09e6ca446 --- /dev/null +++ b/test/azure/pom.xml @@ -0,0 +1,141 @@ + + + 4.0.0 + + com.microsoft.azure + autorest-java + 1.0.0-SNAPSHOT + ../../pom.xml + + + azure-codegen-tests + jar + + AutoRest Java Azure Code Generator Tests + This package contains the tests for the Azure flavored Java code generator. + https://github.com/Azure/autorest + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/autorest + scm:git:git@github.com:Azure/autorest.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + com.microsoft.azure + azure-client-runtime + + + junit + junit + test + + + junit + junit-dep + test + + + org.slf4j + slf4j-simple + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+ + + exec-maven-plugin + org.codehaus.mojo + 1.5.0 + + + run-server + test-compile + + exec + + + node + ${session.executionRootDirectory} + + node_modules/@microsoft.azure/autorest.testserver + + true + + + + report-coverage + test + + java + + + fixtures.azurereport.CoverageReporter + test + false + + + + +
+
+
diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/AutoRestParameterGroupingTestService.java b/test/azure/src/main/java/fixtures/azureparametergrouping/AutoRestParameterGroupingTestService.java new file mode 100644 index 0000000000..69ae9d070e --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/AutoRestParameterGroupingTestService.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestParameterGroupingTestService class. + */ +public interface AutoRestParameterGroupingTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestParameterGroupingTestService withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestParameterGroupingTestService withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestParameterGroupingTestService withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the ParameterGroupings object to access its operations. + * @return the ParameterGroupings object. + */ + ParameterGroupings parameterGroupings(); + +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/ParameterGroupings.java b/test/azure/src/main/java/fixtures/azureparametergrouping/ParameterGroupings.java new file mode 100644 index 0000000000..af90b41d40 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/ParameterGroupings.java @@ -0,0 +1,284 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azureparametergrouping.models.ErrorException; +import fixtures.azureparametergrouping.models.FirstParameterGroup; +import fixtures.azureparametergrouping.models.ParameterGroupingPostMultiParamGroupsSecondParamGroup; +import fixtures.azureparametergrouping.models.ParameterGroupingPostOptionalParameters; +import fixtures.azureparametergrouping.models.ParameterGroupingPostRequiredParameters; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ParameterGroupings. + */ +public interface ParameterGroupings { + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postRequired(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters); + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredAsync(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters, final ServiceCallback serviceCallback); + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postRequiredAsync(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters); + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postRequiredWithServiceResponseAsync(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters); + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptional(); + + /** + * Post a bunch of optional parameters grouped. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalAsync(final ServiceCallback serviceCallback); + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalAsync(); + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalWithServiceResponseAsync(); + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptional(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters); + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalAsync(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters, final ServiceCallback serviceCallback); + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalAsync(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters); + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalWithServiceResponseAsync(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters); + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postMultiParamGroups(); + + /** + * Post parameters from multiple different parameter groups. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postMultiParamGroupsAsync(final ServiceCallback serviceCallback); + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postMultiParamGroupsAsync(); + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postMultiParamGroupsWithServiceResponseAsync(); + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postMultiParamGroups(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup); + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postMultiParamGroupsAsync(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup, final ServiceCallback serviceCallback); + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postMultiParamGroupsAsync(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup); + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postMultiParamGroupsWithServiceResponseAsync(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup); + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postSharedParameterGroupObject(); + + /** + * Post parameters with a shared parameter group object. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postSharedParameterGroupObjectAsync(final ServiceCallback serviceCallback); + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postSharedParameterGroupObjectAsync(); + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postSharedParameterGroupObjectWithServiceResponseAsync(); + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postSharedParameterGroupObject(FirstParameterGroup firstParameterGroup); + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postSharedParameterGroupObjectAsync(FirstParameterGroup firstParameterGroup, final ServiceCallback serviceCallback); + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postSharedParameterGroupObjectAsync(FirstParameterGroup firstParameterGroup); + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postSharedParameterGroupObjectWithServiceResponseAsync(FirstParameterGroup firstParameterGroup); + +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java b/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java new file mode 100644 index 0000000000..4ee3fcaf52 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import fixtures.azureparametergrouping.AutoRestParameterGroupingTestService; +import fixtures.azureparametergrouping.ParameterGroupings; + +/** + * Initializes a new instance of the AutoRestParameterGroupingTestServiceImpl class. + */ +public class AutoRestParameterGroupingTestServiceImpl extends AzureServiceClient implements AutoRestParameterGroupingTestService { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestParameterGroupingTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestParameterGroupingTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestParameterGroupingTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ParameterGroupings object to access its operations. + */ + private ParameterGroupings parameterGroupings; + + /** + * Gets the ParameterGroupings object to access its operations. + * @return the ParameterGroupings object. + */ + public ParameterGroupings parameterGroupings() { + return this.parameterGroupings; + } + + /** + * Initializes an instance of AutoRestParameterGroupingTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestParameterGroupingTestServiceImpl(ServiceClientCredentials credentials) { + this("https://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestParameterGroupingTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestParameterGroupingTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterGroupingTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestParameterGroupingTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.parameterGroupings = new ParameterGroupingsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestParameterGroupingTestService", "1.0.0"); + } +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsImpl.java b/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsImpl.java new file mode 100644 index 0000000000..ef362a9ea8 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsImpl.java @@ -0,0 +1,591 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.implementation; + +import retrofit2.Retrofit; +import fixtures.azureparametergrouping.ParameterGroupings; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.azureparametergrouping.models.ErrorException; +import fixtures.azureparametergrouping.models.FirstParameterGroup; +import fixtures.azureparametergrouping.models.ParameterGroupingPostMultiParamGroupsSecondParamGroup; +import fixtures.azureparametergrouping.models.ParameterGroupingPostOptionalParameters; +import fixtures.azureparametergrouping.models.ParameterGroupingPostRequiredParameters; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ParameterGroupings. + */ +public class ParameterGroupingsImpl implements ParameterGroupings { + /** The Retrofit service to perform REST calls. */ + private ParameterGroupingsService service; + /** The service client containing this operation class. */ + private AutoRestParameterGroupingTestServiceImpl client; + + /** + * Initializes an instance of ParameterGroupingsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ParameterGroupingsImpl(Retrofit retrofit, AutoRestParameterGroupingTestServiceImpl client) { + this.service = retrofit.create(ParameterGroupingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ParameterGroupings to be + * used by Retrofit to perform actually REST calls. + */ + interface ParameterGroupingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureparametergrouping.ParameterGroupings postRequired" }) + @POST("parameterGrouping/postRequired/{path}") + Observable> postRequired(@Path("path") String path, @Header("accept-language") String acceptLanguage, @Body int body, @Header("customHeader") String customHeader, @Query("query") Integer query, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureparametergrouping.ParameterGroupings postOptional" }) + @POST("parameterGrouping/postOptional") + Observable> postOptional(@Header("accept-language") String acceptLanguage, @Header("customHeader") String customHeader, @Query("query") Integer query, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureparametergrouping.ParameterGroupings postMultiParamGroups" }) + @POST("parameterGrouping/postMultipleParameterGroups") + Observable> postMultiParamGroups(@Header("accept-language") String acceptLanguage, @Header("header-one") String headerOne, @Query("query-one") Integer queryOne, @Header("header-two") String headerTwo, @Query("query-two") Integer queryTwo, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureparametergrouping.ParameterGroupings postSharedParameterGroupObject" }) + @POST("parameterGrouping/sharedParameterGroupObject") + Observable> postSharedParameterGroupObject(@Header("accept-language") String acceptLanguage, @Header("header-one") String headerOne, @Query("query-one") Integer queryOne, @Header("User-Agent") String userAgent); + + } + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postRequired(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters) { + postRequiredWithServiceResponseAsync(parameterGroupingPostRequiredParameters).toBlocking().single().body(); + } + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredAsync(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredWithServiceResponseAsync(parameterGroupingPostRequiredParameters), serviceCallback); + } + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postRequiredAsync(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters) { + return postRequiredWithServiceResponseAsync(parameterGroupingPostRequiredParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postRequiredWithServiceResponseAsync(ParameterGroupingPostRequiredParameters parameterGroupingPostRequiredParameters) { + if (parameterGroupingPostRequiredParameters == null) { + throw new IllegalArgumentException("Parameter parameterGroupingPostRequiredParameters is required and cannot be null."); + } + Validator.validate(parameterGroupingPostRequiredParameters); + int body = parameterGroupingPostRequiredParameters.body(); + String customHeader = parameterGroupingPostRequiredParameters.customHeader(); + Integer query = parameterGroupingPostRequiredParameters.query(); + String path = parameterGroupingPostRequiredParameters.path(); + return service.postRequired(path, this.client.acceptLanguage(), body, customHeader, query, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptional() { + postOptionalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalAsync() { + return postOptionalWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalWithServiceResponseAsync() { + final ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters = null; + String customHeader = null; + Integer query = null; + return service.postOptional(this.client.acceptLanguage(), customHeader, query, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptional(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters) { + postOptionalWithServiceResponseAsync(parameterGroupingPostOptionalParameters).toBlocking().single().body(); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalAsync(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalWithServiceResponseAsync(parameterGroupingPostOptionalParameters), serviceCallback); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalAsync(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters) { + return postOptionalWithServiceResponseAsync(parameterGroupingPostOptionalParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalWithServiceResponseAsync(ParameterGroupingPostOptionalParameters parameterGroupingPostOptionalParameters) { + Validator.validate(parameterGroupingPostOptionalParameters); + String customHeader = null; + if (parameterGroupingPostOptionalParameters != null) { + customHeader = parameterGroupingPostOptionalParameters.customHeader(); + } + Integer query = null; + if (parameterGroupingPostOptionalParameters != null) { + query = parameterGroupingPostOptionalParameters.query(); + } + return service.postOptional(this.client.acceptLanguage(), customHeader, query, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMultiParamGroups() { + postMultiParamGroupsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMultiParamGroupsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMultiParamGroupsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMultiParamGroupsAsync() { + return postMultiParamGroupsWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMultiParamGroupsWithServiceResponseAsync() { + final FirstParameterGroup firstParameterGroup = null; + final ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup = null; + String headerOne = null; + Integer queryOne = null; + String headerTwo = null; + Integer queryTwo = null; + return service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMultiParamGroupsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMultiParamGroups(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup) { + postMultiParamGroupsWithServiceResponseAsync(firstParameterGroup, parameterGroupingPostMultiParamGroupsSecondParamGroup).toBlocking().single().body(); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMultiParamGroupsAsync(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMultiParamGroupsWithServiceResponseAsync(firstParameterGroup, parameterGroupingPostMultiParamGroupsSecondParamGroup), serviceCallback); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMultiParamGroupsAsync(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup) { + return postMultiParamGroupsWithServiceResponseAsync(firstParameterGroup, parameterGroupingPostMultiParamGroupsSecondParamGroup).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMultiParamGroupsWithServiceResponseAsync(FirstParameterGroup firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroup parameterGroupingPostMultiParamGroupsSecondParamGroup) { + Validator.validate(firstParameterGroup); + Validator.validate(parameterGroupingPostMultiParamGroupsSecondParamGroup); + String headerOne = null; + if (firstParameterGroup != null) { + headerOne = firstParameterGroup.headerOne(); + } + Integer queryOne = null; + if (firstParameterGroup != null) { + queryOne = firstParameterGroup.queryOne(); + } + String headerTwo = null; + if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) { + headerTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.headerTwo(); + } + Integer queryTwo = null; + if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) { + queryTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.queryTwo(); + } + return service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMultiParamGroupsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMultiParamGroupsDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postSharedParameterGroupObject() { + postSharedParameterGroupObjectWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postSharedParameterGroupObjectAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postSharedParameterGroupObjectWithServiceResponseAsync(), serviceCallback); + } + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postSharedParameterGroupObjectAsync() { + return postSharedParameterGroupObjectWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postSharedParameterGroupObjectWithServiceResponseAsync() { + final FirstParameterGroup firstParameterGroup = null; + String headerOne = null; + Integer queryOne = null; + return service.postSharedParameterGroupObject(this.client.acceptLanguage(), headerOne, queryOne, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postSharedParameterGroupObjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postSharedParameterGroupObject(FirstParameterGroup firstParameterGroup) { + postSharedParameterGroupObjectWithServiceResponseAsync(firstParameterGroup).toBlocking().single().body(); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postSharedParameterGroupObjectAsync(FirstParameterGroup firstParameterGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postSharedParameterGroupObjectWithServiceResponseAsync(firstParameterGroup), serviceCallback); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postSharedParameterGroupObjectAsync(FirstParameterGroup firstParameterGroup) { + return postSharedParameterGroupObjectWithServiceResponseAsync(firstParameterGroup).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postSharedParameterGroupObjectWithServiceResponseAsync(FirstParameterGroup firstParameterGroup) { + Validator.validate(firstParameterGroup); + String headerOne = null; + if (firstParameterGroup != null) { + headerOne = firstParameterGroup.headerOne(); + } + Integer queryOne = null; + if (firstParameterGroup != null) { + queryOne = firstParameterGroup.queryOne(); + } + return service.postSharedParameterGroupObject(this.client.acceptLanguage(), headerOne, queryOne, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postSharedParameterGroupObjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postSharedParameterGroupObjectDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java b/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java new file mode 100644 index 0000000000..191b184e65 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestParameterGroupingTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.azureparametergrouping.implementation; diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/models/Error.java b/test/azure/src/main/java/fixtures/azureparametergrouping/models/Error.java new file mode 100644 index 0000000000..91b7d8515e --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/models/ErrorException.java b/test/azure/src/main/java/fixtures/azureparametergrouping/models/ErrorException.java new file mode 100644 index 0000000000..7c06d59d6d --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java b/test/azure/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java new file mode 100644 index 0000000000..0652cc6808 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/models/FirstParameterGroup.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for a set of operations, such as: + * ParameterGrouping_postMultiParamGroups, + * ParameterGrouping_postSharedParameterGroupObject. + */ +public class FirstParameterGroup { + /** + * The headerOne property. + */ + @JsonProperty(value = "") + private String headerOne; + + /** + * Query parameter with default. + */ + @JsonProperty(value = "") + private Integer queryOne; + + /** + * Get the headerOne value. + * + * @return the headerOne value + */ + public String headerOne() { + return this.headerOne; + } + + /** + * Set the headerOne value. + * + * @param headerOne the headerOne value to set + * @return the FirstParameterGroup object itself. + */ + public FirstParameterGroup withHeaderOne(String headerOne) { + this.headerOne = headerOne; + return this; + } + + /** + * Get the queryOne value. + * + * @return the queryOne value + */ + public Integer queryOne() { + return this.queryOne; + } + + /** + * Set the queryOne value. + * + * @param queryOne the queryOne value to set + * @return the FirstParameterGroup object itself. + */ + public FirstParameterGroup withQueryOne(Integer queryOne) { + this.queryOne = queryOne; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java b/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java new file mode 100644 index 0000000000..ad3dde4157 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostMultiParamGroupsSecondParamGroup.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for postMultiParamGroups operation. + */ +public class ParameterGroupingPostMultiParamGroupsSecondParamGroup { + /** + * The headerTwo property. + */ + @JsonProperty(value = "") + private String headerTwo; + + /** + * Query parameter with default. + */ + @JsonProperty(value = "") + private Integer queryTwo; + + /** + * Get the headerTwo value. + * + * @return the headerTwo value + */ + public String headerTwo() { + return this.headerTwo; + } + + /** + * Set the headerTwo value. + * + * @param headerTwo the headerTwo value to set + * @return the ParameterGroupingPostMultiParamGroupsSecondParamGroup object itself. + */ + public ParameterGroupingPostMultiParamGroupsSecondParamGroup withHeaderTwo(String headerTwo) { + this.headerTwo = headerTwo; + return this; + } + + /** + * Get the queryTwo value. + * + * @return the queryTwo value + */ + public Integer queryTwo() { + return this.queryTwo; + } + + /** + * Set the queryTwo value. + * + * @param queryTwo the queryTwo value to set + * @return the ParameterGroupingPostMultiParamGroupsSecondParamGroup object itself. + */ + public ParameterGroupingPostMultiParamGroupsSecondParamGroup withQueryTwo(Integer queryTwo) { + this.queryTwo = queryTwo; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java b/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java new file mode 100644 index 0000000000..c62cc9b64e --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostOptionalParameters.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for postOptional operation. + */ +public class ParameterGroupingPostOptionalParameters { + /** + * The customHeader property. + */ + @JsonProperty(value = "") + private String customHeader; + + /** + * Query parameter with default. + */ + @JsonProperty(value = "") + private Integer query; + + /** + * Get the customHeader value. + * + * @return the customHeader value + */ + public String customHeader() { + return this.customHeader; + } + + /** + * Set the customHeader value. + * + * @param customHeader the customHeader value to set + * @return the ParameterGroupingPostOptionalParameters object itself. + */ + public ParameterGroupingPostOptionalParameters withCustomHeader(String customHeader) { + this.customHeader = customHeader; + return this; + } + + /** + * Get the query value. + * + * @return the query value + */ + public Integer query() { + return this.query; + } + + /** + * Set the query value. + * + * @param query the query value to set + * @return the ParameterGroupingPostOptionalParameters object itself. + */ + public ParameterGroupingPostOptionalParameters withQuery(Integer query) { + this.query = query; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java b/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java new file mode 100644 index 0000000000..9764ed43e3 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/models/ParameterGroupingPostRequiredParameters.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for postRequired operation. + */ +public class ParameterGroupingPostRequiredParameters { + /** + * The body property. + */ + @JsonProperty(value = "", required = true) + private int body; + + /** + * The customHeader property. + */ + @JsonProperty(value = "") + private String customHeader; + + /** + * Query parameter with default. + */ + @JsonProperty(value = "") + private Integer query; + + /** + * Path parameter. + */ + @JsonProperty(value = "", required = true) + private String path; + + /** + * Get the body value. + * + * @return the body value + */ + public int body() { + return this.body; + } + + /** + * Set the body value. + * + * @param body the body value to set + * @return the ParameterGroupingPostRequiredParameters object itself. + */ + public ParameterGroupingPostRequiredParameters withBody(int body) { + this.body = body; + return this; + } + + /** + * Get the customHeader value. + * + * @return the customHeader value + */ + public String customHeader() { + return this.customHeader; + } + + /** + * Set the customHeader value. + * + * @param customHeader the customHeader value to set + * @return the ParameterGroupingPostRequiredParameters object itself. + */ + public ParameterGroupingPostRequiredParameters withCustomHeader(String customHeader) { + this.customHeader = customHeader; + return this; + } + + /** + * Get the query value. + * + * @return the query value + */ + public Integer query() { + return this.query; + } + + /** + * Set the query value. + * + * @param query the query value to set + * @return the ParameterGroupingPostRequiredParameters object itself. + */ + public ParameterGroupingPostRequiredParameters withQuery(Integer query) { + this.query = query; + return this; + } + + /** + * Get the path value. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path value. + * + * @param path the path value to set + * @return the ParameterGroupingPostRequiredParameters object itself. + */ + public ParameterGroupingPostRequiredParameters withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/models/package-info.java b/test/azure/src/main/java/fixtures/azureparametergrouping/models/package-info.java new file mode 100644 index 0000000000..e30bc323b3 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestParameterGroupingTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.azureparametergrouping.models; diff --git a/test/azure/src/main/java/fixtures/azureparametergrouping/package-info.java b/test/azure/src/main/java/fixtures/azureparametergrouping/package-info.java new file mode 100644 index 0000000000..e7d821411f --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureparametergrouping/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestParameterGroupingTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.azureparametergrouping; diff --git a/test/azure/src/main/java/fixtures/azurereport/AutoRestReportServiceForAzure.java b/test/azure/src/main/java/fixtures/azurereport/AutoRestReportServiceForAzure.java new file mode 100644 index 0000000000..78938d5ae8 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurereport/AutoRestReportServiceForAzure.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurereport; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurereport.models.ErrorException; +import java.io.IOException; +import java.util.Map; +import rx.Observable; + +/** + * The interface for AutoRestReportServiceForAzure class. + */ +public interface AutoRestReportServiceForAzure { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestReportServiceForAzure withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestReportServiceForAzure withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestReportServiceForAzure withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + Map getReport(); + + /** + * Get test coverage report. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getReportAsync(final ServiceCallback> serviceCallback); + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable> getReportAsync(); + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable>> getReportWithServiceResponseAsync(); + +} diff --git a/test/azure/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java b/test/azure/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java new file mode 100644 index 0000000000..8087175e9d --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java @@ -0,0 +1,248 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurereport.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurereport.AutoRestReportServiceForAzure; +import fixtures.azurereport.models.ErrorException; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the AutoRestReportServiceForAzureImpl class. + */ +public class AutoRestReportServiceForAzureImpl extends AzureServiceClient implements AutoRestReportServiceForAzure { + /** The Retrofit service to perform REST calls. */ + private AutoRestReportServiceForAzureService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestReportServiceForAzureImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestReportServiceForAzureImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestReportServiceForAzureImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of AutoRestReportServiceForAzure client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestReportServiceForAzureImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestReportServiceForAzure client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestReportServiceForAzureImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestReportServiceForAzure client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestReportServiceForAzureImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestReportServiceForAzure", "1.0.0"); + } + + private void initializeService() { + service = restClient().retrofit().create(AutoRestReportServiceForAzureService.class); + } + + /** + * The interface defining all the services for AutoRestReportServiceForAzure to be + * used by Retrofit to perform actually REST calls. + */ + interface AutoRestReportServiceForAzureService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurereport.AutoRestReportServiceForAzure getReport" }) + @GET("report/azure") + Observable> getReport(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + public Map getReport() { + return getReportWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get test coverage report. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getReportAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getReportWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable> getReportAsync() { + return getReportWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable>> getReportWithServiceResponseAsync() { + return service.getReport(this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getReportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getReportDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurereport/implementation/package-info.java b/test/azure/src/main/java/fixtures/azurereport/implementation/package-info.java new file mode 100644 index 0000000000..769426621a --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurereport/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestReportServiceForAzure. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurereport.implementation; diff --git a/test/azure/src/main/java/fixtures/azurereport/models/Error.java b/test/azure/src/main/java/fixtures/azurereport/models/Error.java new file mode 100644 index 0000000000..95faab68ad --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurereport/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurereport.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azurereport/models/ErrorException.java b/test/azure/src/main/java/fixtures/azurereport/models/ErrorException.java new file mode 100644 index 0000000000..d4d9330f86 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurereport/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurereport.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azure/src/main/java/fixtures/azurereport/models/package-info.java b/test/azure/src/main/java/fixtures/azurereport/models/package-info.java new file mode 100644 index 0000000000..10dd5da3f7 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurereport/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestReportServiceForAzure. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurereport.models; diff --git a/test/azure/src/main/java/fixtures/azurereport/package-info.java b/test/azure/src/main/java/fixtures/azurereport/package-info.java new file mode 100644 index 0000000000..8138a8bbc3 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurereport/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestReportServiceForAzure. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurereport; diff --git a/test/azure/src/main/java/fixtures/azureresource/AutoRestResourceFlatteningTestService.java b/test/azure/src/main/java/fixtures/azureresource/AutoRestResourceFlatteningTestService.java new file mode 100644 index 0000000000..0243ebb748 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/AutoRestResourceFlatteningTestService.java @@ -0,0 +1,414 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.Resource; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azureresource.models.ErrorException; +import fixtures.azureresource.models.FlattenedProduct; +import fixtures.azureresource.models.ResourceCollection; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import rx.Observable; + +/** + * The interface for AutoRestResourceFlatteningTestService class. + */ +public interface AutoRestResourceFlatteningTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestResourceFlatteningTestService withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestResourceFlatteningTestService withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestResourceFlatteningTestService withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putArray(); + + /** + * Put External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putArrayAsync(final ServiceCallback serviceCallback); + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putArrayAsync(); + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putArrayWithServiceResponseAsync(); + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putArray(List resourceArray); + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putArrayAsync(List resourceArray, final ServiceCallback serviceCallback); + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putArrayAsync(List resourceArray); + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putArrayWithServiceResponseAsync(List resourceArray); + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FlattenedProduct> object if successful. + */ + List getArray(); + + /** + * Get External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getArrayAsync(final ServiceCallback> serviceCallback); + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProduct> object + */ + Observable> getArrayAsync(); + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProduct> object + */ + Observable>> getArrayWithServiceResponseAsync(); + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDictionary(); + + /** + * Put External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDictionaryAsync(final ServiceCallback serviceCallback); + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDictionaryAsync(); + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDictionaryWithServiceResponseAsync(); + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDictionary(Map resourceDictionary); + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDictionaryAsync(Map resourceDictionary, final ServiceCallback serviceCallback); + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDictionaryAsync(Map resourceDictionary); + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDictionaryWithServiceResponseAsync(Map resourceDictionary); + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, FlattenedProduct> object if successful. + */ + Map getDictionary(); + + /** + * Get External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDictionaryAsync(final ServiceCallback> serviceCallback); + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProduct> object + */ + Observable> getDictionaryAsync(); + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProduct> object + */ + Observable>> getDictionaryWithServiceResponseAsync(); + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putResourceCollection(); + + /** + * Put External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putResourceCollectionAsync(final ServiceCallback serviceCallback); + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putResourceCollectionAsync(); + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putResourceCollectionWithServiceResponseAsync(); + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putResourceCollection(ResourceCollection resourceComplexObject); + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putResourceCollectionAsync(ResourceCollection resourceComplexObject, final ServiceCallback serviceCallback); + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putResourceCollectionAsync(ResourceCollection resourceComplexObject); + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putResourceCollectionWithServiceResponseAsync(ResourceCollection resourceComplexObject); + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceCollection object if successful. + */ + ResourceCollection getResourceCollection(); + + /** + * Get External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getResourceCollectionAsync(final ServiceCallback serviceCallback); + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollection object + */ + Observable getResourceCollectionAsync(); + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollection object + */ + Observable> getResourceCollectionWithServiceResponseAsync(); + +} diff --git a/test/azure/src/main/java/fixtures/azureresource/implementation/AutoRestResourceFlatteningTestServiceImpl.java b/test/azure/src/main/java/fixtures/azureresource/implementation/AutoRestResourceFlatteningTestServiceImpl.java new file mode 100644 index 0000000000..63229f0865 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/implementation/AutoRestResourceFlatteningTestServiceImpl.java @@ -0,0 +1,794 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.Resource; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.azureresource.AutoRestResourceFlatteningTestService; +import fixtures.azureresource.models.ErrorException; +import fixtures.azureresource.models.FlattenedProduct; +import fixtures.azureresource.models.ResourceCollection; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the AutoRestResourceFlatteningTestServiceImpl class. + */ +public class AutoRestResourceFlatteningTestServiceImpl extends AzureServiceClient implements AutoRestResourceFlatteningTestService { + /** The Retrofit service to perform REST calls. */ + private AutoRestResourceFlatteningTestServiceService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestResourceFlatteningTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestResourceFlatteningTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestResourceFlatteningTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestResourceFlatteningTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestResourceFlatteningTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestResourceFlatteningTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestResourceFlatteningTestService", "1.0.0"); + } + + private void initializeService() { + service = restClient().retrofit().create(AutoRestResourceFlatteningTestServiceService.class); + } + + /** + * The interface defining all the services for AutoRestResourceFlatteningTestService to be + * used by Retrofit to perform actually REST calls. + */ + interface AutoRestResourceFlatteningTestServiceService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService putArray" }) + @PUT("azure/resource-flatten/array") + Observable> putArray(@Body List resourceArray, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService getArray" }) + @GET("azure/resource-flatten/array") + Observable> getArray(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService putDictionary" }) + @PUT("azure/resource-flatten/dictionary") + Observable> putDictionary(@Body Map resourceDictionary, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService getDictionary" }) + @GET("azure/resource-flatten/dictionary") + Observable> getDictionary(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService putResourceCollection" }) + @PUT("azure/resource-flatten/resourcecollection") + Observable> putResourceCollection(@Body ResourceCollection resourceComplexObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService getResourceCollection" }) + @GET("azure/resource-flatten/resourcecollection") + Observable> getResourceCollection(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putArray() { + putArrayWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putArrayAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putArrayWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putArrayAsync() { + return putArrayWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putArrayWithServiceResponseAsync() { + final List resourceArray = null; + return service.putArray(resourceArray, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putArray(List resourceArray) { + putArrayWithServiceResponseAsync(resourceArray).toBlocking().single().body(); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putArrayAsync(List resourceArray, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putArrayWithServiceResponseAsync(resourceArray), serviceCallback); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putArrayAsync(List resourceArray) { + return putArrayWithServiceResponseAsync(resourceArray).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putArrayWithServiceResponseAsync(List resourceArray) { + Validator.validate(resourceArray); + return service.putArray(resourceArray, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putArrayDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FlattenedProduct> object if successful. + */ + public List getArray() { + return getArrayWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getArrayAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getArrayWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProduct> object + */ + public Observable> getArrayAsync() { + return getArrayWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProduct> object + */ + public Observable>> getArrayWithServiceResponseAsync() { + return service.getArray(this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getArrayDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDictionary() { + putDictionaryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDictionaryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDictionaryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDictionaryAsync() { + return putDictionaryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDictionaryWithServiceResponseAsync() { + final Map resourceDictionary = null; + return service.putDictionary(resourceDictionary, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDictionary(Map resourceDictionary) { + putDictionaryWithServiceResponseAsync(resourceDictionary).toBlocking().single().body(); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDictionaryAsync(Map resourceDictionary, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDictionaryWithServiceResponseAsync(resourceDictionary), serviceCallback); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDictionaryAsync(Map resourceDictionary) { + return putDictionaryWithServiceResponseAsync(resourceDictionary).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDictionaryWithServiceResponseAsync(Map resourceDictionary) { + Validator.validate(resourceDictionary); + return service.putDictionary(resourceDictionary, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDictionaryDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, FlattenedProduct> object if successful. + */ + public Map getDictionary() { + return getDictionaryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDictionaryAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProduct> object + */ + public Observable> getDictionaryAsync() { + return getDictionaryWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProduct> object + */ + public Observable>> getDictionaryWithServiceResponseAsync() { + return service.getDictionary(this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDictionaryDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putResourceCollection() { + putResourceCollectionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putResourceCollectionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putResourceCollectionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putResourceCollectionAsync() { + return putResourceCollectionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putResourceCollectionWithServiceResponseAsync() { + final ResourceCollection resourceComplexObject = null; + return service.putResourceCollection(resourceComplexObject, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putResourceCollection(ResourceCollection resourceComplexObject) { + putResourceCollectionWithServiceResponseAsync(resourceComplexObject).toBlocking().single().body(); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putResourceCollectionAsync(ResourceCollection resourceComplexObject, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putResourceCollectionWithServiceResponseAsync(resourceComplexObject), serviceCallback); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putResourceCollectionAsync(ResourceCollection resourceComplexObject) { + return putResourceCollectionWithServiceResponseAsync(resourceComplexObject).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putResourceCollectionWithServiceResponseAsync(ResourceCollection resourceComplexObject) { + Validator.validate(resourceComplexObject); + return service.putResourceCollection(resourceComplexObject, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putResourceCollectionDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceCollection object if successful. + */ + public ResourceCollection getResourceCollection() { + return getResourceCollectionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getResourceCollectionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getResourceCollectionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollection object + */ + public Observable getResourceCollectionAsync() { + return getResourceCollectionWithServiceResponseAsync().map(new Func1, ResourceCollection>() { + @Override + public ResourceCollection call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollection object + */ + public Observable> getResourceCollectionWithServiceResponseAsync() { + return service.getResourceCollection(this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getResourceCollectionDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azureresource/implementation/package-info.java b/test/azure/src/main/java/fixtures/azureresource/implementation/package-info.java new file mode 100644 index 0000000000..941141e066 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestResourceFlatteningTestService. + * Resource Flattening for AutoRest. + */ +package fixtures.azureresource.implementation; diff --git a/test/azure/src/main/java/fixtures/azureresource/models/Error.java b/test/azure/src/main/java/fixtures/azureresource/models/Error.java new file mode 100644 index 0000000000..63bfb62235 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azureresource/models/ErrorException.java b/test/azure/src/main/java/fixtures/azureresource/models/ErrorException.java new file mode 100644 index 0000000000..32385d0edf --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azure/src/main/java/fixtures/azureresource/models/FlattenedProduct.java b/test/azure/src/main/java/fixtures/azureresource/models/FlattenedProduct.java new file mode 100644 index 0000000000..e16a7fe3b8 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/models/FlattenedProduct.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The FlattenedProduct model. + */ +@JsonFlatten +public class FlattenedProduct extends Resource { + /** + * The pname property. + */ + @JsonProperty(value = "properties.pname") + private String pname; + + /** + * The lsize property. + */ + @JsonProperty(value = "properties.lsize") + private Integer lsize; + + /** + * The provisioningState property. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Get the pname value. + * + * @return the pname value + */ + public String pname() { + return this.pname; + } + + /** + * Set the pname value. + * + * @param pname the pname value to set + * @return the FlattenedProduct object itself. + */ + public FlattenedProduct withPname(String pname) { + this.pname = pname; + return this; + } + + /** + * Get the lsize value. + * + * @return the lsize value + */ + public Integer lsize() { + return this.lsize; + } + + /** + * Set the lsize value. + * + * @param lsize the lsize value to set + * @return the FlattenedProduct object itself. + */ + public FlattenedProduct withLsize(Integer lsize) { + this.lsize = lsize; + return this; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the FlattenedProduct object itself. + */ + public FlattenedProduct withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azureresource/models/ResourceCollection.java b/test/azure/src/main/java/fixtures/azureresource/models/ResourceCollection.java new file mode 100644 index 0000000000..2985b8155c --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/models/ResourceCollection.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource.models; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceCollection model. + */ +public class ResourceCollection { + /** + * The productresource property. + */ + @JsonProperty(value = "productresource") + private FlattenedProduct productresource; + + /** + * The arrayofresources property. + */ + @JsonProperty(value = "arrayofresources") + private List arrayofresources; + + /** + * The dictionaryofresources property. + */ + @JsonProperty(value = "dictionaryofresources") + private Map dictionaryofresources; + + /** + * Get the productresource value. + * + * @return the productresource value + */ + public FlattenedProduct productresource() { + return this.productresource; + } + + /** + * Set the productresource value. + * + * @param productresource the productresource value to set + * @return the ResourceCollection object itself. + */ + public ResourceCollection withProductresource(FlattenedProduct productresource) { + this.productresource = productresource; + return this; + } + + /** + * Get the arrayofresources value. + * + * @return the arrayofresources value + */ + public List arrayofresources() { + return this.arrayofresources; + } + + /** + * Set the arrayofresources value. + * + * @param arrayofresources the arrayofresources value to set + * @return the ResourceCollection object itself. + */ + public ResourceCollection withArrayofresources(List arrayofresources) { + this.arrayofresources = arrayofresources; + return this; + } + + /** + * Get the dictionaryofresources value. + * + * @return the dictionaryofresources value + */ + public Map dictionaryofresources() { + return this.dictionaryofresources; + } + + /** + * Set the dictionaryofresources value. + * + * @param dictionaryofresources the dictionaryofresources value to set + * @return the ResourceCollection object itself. + */ + public ResourceCollection withDictionaryofresources(Map dictionaryofresources) { + this.dictionaryofresources = dictionaryofresources; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azureresource/models/package-info.java b/test/azure/src/main/java/fixtures/azureresource/models/package-info.java new file mode 100644 index 0000000000..2c484ffc3d --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestResourceFlatteningTestService. + * Resource Flattening for AutoRest. + */ +package fixtures.azureresource.models; diff --git a/test/azure/src/main/java/fixtures/azureresource/package-info.java b/test/azure/src/main/java/fixtures/azureresource/package-info.java new file mode 100644 index 0000000000..177aec70ce --- /dev/null +++ b/test/azure/src/main/java/fixtures/azureresource/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestResourceFlatteningTestService. + * Resource Flattening for AutoRest. + */ +package fixtures.azureresource; diff --git a/test/azure/src/main/java/fixtures/azurespecials/ApiVersionDefaults.java b/test/azure/src/main/java/fixtures/azurespecials/ApiVersionDefaults.java new file mode 100644 index 0000000000..8ffa666955 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/ApiVersionDefaults.java @@ -0,0 +1,161 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApiVersionDefaults. + */ +public interface ApiVersionDefaults { + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodGlobalValid(); + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodGlobalValidAsync(final ServiceCallback serviceCallback); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodGlobalValidAsync(); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodGlobalValidWithServiceResponseAsync(); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodGlobalNotProvidedValid(); + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodGlobalNotProvidedValidAsync(final ServiceCallback serviceCallback); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodGlobalNotProvidedValidAsync(); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodGlobalNotProvidedValidWithServiceResponseAsync(); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getPathGlobalValid(); + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getPathGlobalValidAsync(final ServiceCallback serviceCallback); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getPathGlobalValidAsync(); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getPathGlobalValidWithServiceResponseAsync(); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getSwaggerGlobalValid(); + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSwaggerGlobalValidAsync(final ServiceCallback serviceCallback); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getSwaggerGlobalValidAsync(); + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getSwaggerGlobalValidWithServiceResponseAsync(); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/ApiVersionLocals.java b/test/azure/src/main/java/fixtures/azurespecials/ApiVersionLocals.java new file mode 100644 index 0000000000..6dc7fac2a9 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/ApiVersionLocals.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApiVersionLocals. + */ +public interface ApiVersionLocals { + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodLocalValid(); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodLocalValidAsync(final ServiceCallback serviceCallback); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodLocalValidAsync(); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodLocalValidWithServiceResponseAsync(); + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodLocalNull(); + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodLocalNullAsync(final ServiceCallback serviceCallback); + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodLocalNullAsync(); + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodLocalNullWithServiceResponseAsync(); + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodLocalNull(String apiVersion); + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodLocalNullAsync(String apiVersion, final ServiceCallback serviceCallback); + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodLocalNullAsync(String apiVersion); + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodLocalNullWithServiceResponseAsync(String apiVersion); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getPathLocalValid(); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getPathLocalValidAsync(final ServiceCallback serviceCallback); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getPathLocalValidAsync(); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getPathLocalValidWithServiceResponseAsync(); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getSwaggerLocalValid(); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSwaggerLocalValidAsync(final ServiceCallback serviceCallback); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getSwaggerLocalValidAsync(); + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getSwaggerLocalValidWithServiceResponseAsync(); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/AutoRestAzureSpecialParametersTestClient.java b/test/azure/src/main/java/fixtures/azurespecials/AutoRestAzureSpecialParametersTestClient.java new file mode 100644 index 0000000000..0306bb9d8e --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/AutoRestAzureSpecialParametersTestClient.java @@ -0,0 +1,155 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestAzureSpecialParametersTestClient class. + */ +public interface AutoRestAzureSpecialParametersTestClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Sets The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + AutoRestAzureSpecialParametersTestClient withSubscriptionId(String subscriptionId); + + /** + * Gets The api version, which appears in the query, the value is always '2015-07-01-preview'. + * + * @return the apiVersion value. + */ + String apiVersion(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestAzureSpecialParametersTestClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestAzureSpecialParametersTestClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestAzureSpecialParametersTestClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the XMsClientRequestIds object to access its operations. + * @return the XMsClientRequestIds object. + */ + XMsClientRequestIds xMsClientRequestIds(); + + /** + * Gets the SubscriptionInCredentials object to access its operations. + * @return the SubscriptionInCredentials object. + */ + SubscriptionInCredentials subscriptionInCredentials(); + + /** + * Gets the SubscriptionInMethods object to access its operations. + * @return the SubscriptionInMethods object. + */ + SubscriptionInMethods subscriptionInMethods(); + + /** + * Gets the ApiVersionDefaults object to access its operations. + * @return the ApiVersionDefaults object. + */ + ApiVersionDefaults apiVersionDefaults(); + + /** + * Gets the ApiVersionLocals object to access its operations. + * @return the ApiVersionLocals object. + */ + ApiVersionLocals apiVersionLocals(); + + /** + * Gets the SkipUrlEncodings object to access its operations. + * @return the SkipUrlEncodings object. + */ + SkipUrlEncodings skipUrlEncodings(); + + /** + * Gets the Odatas object to access its operations. + * @return the Odatas object. + */ + Odatas odatas(); + + /** + * Gets the Headers object to access its operations. + * @return the Headers object. + */ + Headers headers(); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/Headers.java b/test/azure/src/main/java/fixtures/azurespecials/Headers.java new file mode 100644 index 0000000000..f6d1fbe89e --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/Headers.java @@ -0,0 +1,144 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.azurespecials.models.ErrorException; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdHeadHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdParamGroupingHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdParamGroupingParameters; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Headers. + */ +public interface Headers { + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void customNamedRequestId(String fooClientRequestId); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture customNamedRequestIdAsync(String fooClientRequestId, final ServiceCallback serviceCallback); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable customNamedRequestIdAsync(String fooClientRequestId); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> customNamedRequestIdWithServiceResponseAsync(String fooClientRequestId); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void customNamedRequestIdParamGrouping(HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture customNamedRequestIdParamGroupingAsync(HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters, final ServiceCallback serviceCallback); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable customNamedRequestIdParamGroupingAsync(HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> customNamedRequestIdParamGroupingWithServiceResponseAsync(HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean customNamedRequestIdHead(String fooClientRequestId); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture customNamedRequestIdHeadAsync(String fooClientRequestId, final ServiceCallback serviceCallback); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable customNamedRequestIdHeadAsync(String fooClientRequestId); + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> customNamedRequestIdHeadWithServiceResponseAsync(String fooClientRequestId); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/Odatas.java b/test/azure/src/main/java/fixtures/azurespecials/Odatas.java new file mode 100644 index 0000000000..98c2667d54 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/Odatas.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Odatas. + */ +public interface Odatas { + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getWithFilter(); + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getWithFilterAsync(final ServiceCallback serviceCallback); + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getWithFilterAsync(); + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getWithFilterWithServiceResponseAsync(); + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getWithFilter(String filter, Integer top, String orderby); + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getWithFilterAsync(String filter, Integer top, String orderby, final ServiceCallback serviceCallback); + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getWithFilterAsync(String filter, Integer top, String orderby); + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getWithFilterWithServiceResponseAsync(String filter, Integer top, String orderby); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/SkipUrlEncodings.java b/test/azure/src/main/java/fixtures/azurespecials/SkipUrlEncodings.java new file mode 100644 index 0000000000..7a9c92856b --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/SkipUrlEncodings.java @@ -0,0 +1,316 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SkipUrlEncodings. + */ +public interface SkipUrlEncodings { + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodPathValid(String unencodedPathParam); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodPathValidAsync(String unencodedPathParam, final ServiceCallback serviceCallback); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodPathValidAsync(String unencodedPathParam); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodPathValidWithServiceResponseAsync(String unencodedPathParam); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getPathPathValid(String unencodedPathParam); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getPathPathValidAsync(String unencodedPathParam, final ServiceCallback serviceCallback); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getPathPathValidAsync(String unencodedPathParam); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getPathPathValidWithServiceResponseAsync(String unencodedPathParam); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getSwaggerPathValid(); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSwaggerPathValidAsync(final ServiceCallback serviceCallback); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getSwaggerPathValidAsync(); + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getSwaggerPathValidWithServiceResponseAsync(); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodQueryValid(String q1); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodQueryValidAsync(String q1, final ServiceCallback serviceCallback); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodQueryValidAsync(String q1); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodQueryValidWithServiceResponseAsync(String q1); + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodQueryNull(); + + /** + * Get method with unencoded query parameter with value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodQueryNullAsync(final ServiceCallback serviceCallback); + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodQueryNullAsync(); + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodQueryNullWithServiceResponseAsync(); + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getMethodQueryNull(String q1); + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMethodQueryNullAsync(String q1, final ServiceCallback serviceCallback); + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getMethodQueryNullAsync(String q1); + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getMethodQueryNullWithServiceResponseAsync(String q1); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getPathQueryValid(String q1); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getPathQueryValidAsync(String q1, final ServiceCallback serviceCallback); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getPathQueryValidAsync(String q1); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getPathQueryValidWithServiceResponseAsync(String q1); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getSwaggerQueryValid(); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSwaggerQueryValidAsync(final ServiceCallback serviceCallback); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getSwaggerQueryValidAsync(); + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getSwaggerQueryValidWithServiceResponseAsync(); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/SubscriptionInCredentials.java b/test/azure/src/main/java/fixtures/azurespecials/SubscriptionInCredentials.java new file mode 100644 index 0000000000..0fc4406bfb --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/SubscriptionInCredentials.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SubscriptionInCredentials. + */ +public interface SubscriptionInCredentials { + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postMethodGlobalValid(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postMethodGlobalValidAsync(final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postMethodGlobalValidAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postMethodGlobalValidWithServiceResponseAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postMethodGlobalNull(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postMethodGlobalNullAsync(final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postMethodGlobalNullAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postMethodGlobalNullWithServiceResponseAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postMethodGlobalNotProvidedValid(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postMethodGlobalNotProvidedValidAsync(final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postMethodGlobalNotProvidedValidAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postMethodGlobalNotProvidedValidWithServiceResponseAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postPathGlobalValid(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postPathGlobalValidAsync(final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postPathGlobalValidAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postPathGlobalValidWithServiceResponseAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postSwaggerGlobalValid(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postSwaggerGlobalValidAsync(final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postSwaggerGlobalValidAsync(); + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postSwaggerGlobalValidWithServiceResponseAsync(); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/SubscriptionInMethods.java b/test/azure/src/main/java/fixtures/azurespecials/SubscriptionInMethods.java new file mode 100644 index 0000000000..bd4a36a587 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/SubscriptionInMethods.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SubscriptionInMethods. + */ +public interface SubscriptionInMethods { + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postMethodLocalValid(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postMethodLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postMethodLocalValidAsync(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postMethodLocalValidWithServiceResponseAsync(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postMethodLocalNull(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postMethodLocalNullAsync(String subscriptionId, final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postMethodLocalNullAsync(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postMethodLocalNullWithServiceResponseAsync(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postPathLocalValid(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postPathLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postPathLocalValidAsync(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postPathLocalValidWithServiceResponseAsync(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postSwaggerLocalValid(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postSwaggerLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postSwaggerLocalValidAsync(String subscriptionId); + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postSwaggerLocalValidWithServiceResponseAsync(String subscriptionId); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/XMsClientRequestIds.java b/test/azure/src/main/java/fixtures/azurespecials/XMsClientRequestIds.java new file mode 100644 index 0000000000..3c4eb36ed8 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/XMsClientRequestIds.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in XMsClientRequestIds. + */ +public interface XMsClientRequestIds { + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get(); + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAsync(final ServiceCallback serviceCallback); + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getAsync(); + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getWithServiceResponseAsync(); + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramGet(String xMsClientRequestId); + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramGetAsync(String xMsClientRequestId, final ServiceCallback serviceCallback); + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramGetAsync(String xMsClientRequestId); + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramGetWithServiceResponseAsync(String xMsClientRequestId); + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/ApiVersionDefaultsImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/ApiVersionDefaultsImpl.java new file mode 100644 index 0000000000..6dfdbb956e --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/ApiVersionDefaultsImpl.java @@ -0,0 +1,346 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import fixtures.azurespecials.ApiVersionDefaults; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApiVersionDefaults. + */ +public class ApiVersionDefaultsImpl implements ApiVersionDefaults { + /** The Retrofit service to perform REST calls. */ + private ApiVersionDefaultsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of ApiVersionDefaultsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApiVersionDefaultsImpl(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(ApiVersionDefaultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApiVersionDefaults to be + * used by Retrofit to perform actually REST calls. + */ + interface ApiVersionDefaultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionDefaults getMethodGlobalValid" }) + @GET("azurespecials/apiVersion/method/string/none/query/global/2015-07-01-preview") + Observable> getMethodGlobalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionDefaults getMethodGlobalNotProvidedValid" }) + @GET("azurespecials/apiVersion/method/string/none/query/globalNotProvided/2015-07-01-preview") + Observable> getMethodGlobalNotProvidedValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionDefaults getPathGlobalValid" }) + @GET("azurespecials/apiVersion/path/string/none/query/global/2015-07-01-preview") + Observable> getPathGlobalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionDefaults getSwaggerGlobalValid" }) + @GET("azurespecials/apiVersion/swagger/string/none/query/global/2015-07-01-preview") + Observable> getSwaggerGlobalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodGlobalValid() { + getMethodGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodGlobalValidAsync() { + return getMethodGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodGlobalValidWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMethodGlobalValid(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodGlobalNotProvidedValid() { + getMethodGlobalNotProvidedValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodGlobalNotProvidedValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodGlobalNotProvidedValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodGlobalNotProvidedValidAsync() { + return getMethodGlobalNotProvidedValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodGlobalNotProvidedValidWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMethodGlobalNotProvidedValid(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodGlobalNotProvidedValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodGlobalNotProvidedValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getPathGlobalValid() { + getPathGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPathGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPathGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getPathGlobalValidAsync() { + return getPathGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getPathGlobalValidWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPathGlobalValid(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPathGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPathGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getSwaggerGlobalValid() { + getSwaggerGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSwaggerGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSwaggerGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getSwaggerGlobalValidAsync() { + return getSwaggerGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getSwaggerGlobalValidWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getSwaggerGlobalValid(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSwaggerGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSwaggerGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/ApiVersionLocalsImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/ApiVersionLocalsImpl.java new file mode 100644 index 0000000000..466a6e650b --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/ApiVersionLocalsImpl.java @@ -0,0 +1,400 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import fixtures.azurespecials.ApiVersionLocals; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApiVersionLocals. + */ +public class ApiVersionLocalsImpl implements ApiVersionLocals { + /** The Retrofit service to perform REST calls. */ + private ApiVersionLocalsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of ApiVersionLocalsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApiVersionLocalsImpl(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(ApiVersionLocalsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApiVersionLocals to be + * used by Retrofit to perform actually REST calls. + */ + interface ApiVersionLocalsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionLocals getMethodLocalValid" }) + @GET("azurespecials/apiVersion/method/string/none/query/local/2.0") + Observable> getMethodLocalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionLocals getMethodLocalNull" }) + @GET("azurespecials/apiVersion/method/string/none/query/local/null") + Observable> getMethodLocalNull(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionLocals getPathLocalValid" }) + @GET("azurespecials/apiVersion/path/string/none/query/local/2.0") + Observable> getPathLocalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionLocals getSwaggerLocalValid" }) + @GET("azurespecials/apiVersion/swagger/string/none/query/local/2.0") + Observable> getSwaggerLocalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodLocalValid() { + getMethodLocalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodLocalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodLocalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodLocalValidAsync() { + return getMethodLocalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodLocalValidWithServiceResponseAsync() { + final String apiVersion = "2.0"; + return service.getMethodLocalValid(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodLocalValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodLocalNull() { + getMethodLocalNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodLocalNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodLocalNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodLocalNullAsync() { + return getMethodLocalNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodLocalNullWithServiceResponseAsync() { + final String apiVersion = null; + return service.getMethodLocalNull(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodLocalNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodLocalNull(String apiVersion) { + getMethodLocalNullWithServiceResponseAsync(apiVersion).toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodLocalNullAsync(String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodLocalNullWithServiceResponseAsync(apiVersion), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodLocalNullAsync(String apiVersion) { + return getMethodLocalNullWithServiceResponseAsync(apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodLocalNullWithServiceResponseAsync(String apiVersion) { + return service.getMethodLocalNull(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodLocalNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodLocalNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getPathLocalValid() { + getPathLocalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPathLocalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPathLocalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getPathLocalValidAsync() { + return getPathLocalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getPathLocalValidWithServiceResponseAsync() { + final String apiVersion = "2.0"; + return service.getPathLocalValid(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPathLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPathLocalValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getSwaggerLocalValid() { + getSwaggerLocalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSwaggerLocalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSwaggerLocalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getSwaggerLocalValidAsync() { + return getSwaggerLocalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getSwaggerLocalValidWithServiceResponseAsync() { + final String apiVersion = "2.0"; + return service.getSwaggerLocalValid(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSwaggerLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSwaggerLocalValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/AutoRestAzureSpecialParametersTestClientImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/AutoRestAzureSpecialParametersTestClientImpl.java new file mode 100644 index 0000000000..d2b61a81ec --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/AutoRestAzureSpecialParametersTestClientImpl.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import fixtures.azurespecials.ApiVersionDefaults; +import fixtures.azurespecials.ApiVersionLocals; +import fixtures.azurespecials.AutoRestAzureSpecialParametersTestClient; +import fixtures.azurespecials.Headers; +import fixtures.azurespecials.Odatas; +import fixtures.azurespecials.SkipUrlEncodings; +import fixtures.azurespecials.SubscriptionInCredentials; +import fixtures.azurespecials.SubscriptionInMethods; +import fixtures.azurespecials.XMsClientRequestIds; + +/** + * Initializes a new instance of the AutoRestAzureSpecialParametersTestClientImpl class. + */ +public class AutoRestAzureSpecialParametersTestClientImpl extends AzureServiceClient implements AutoRestAzureSpecialParametersTestClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'. */ + private String subscriptionId; + + /** + * Gets The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AutoRestAzureSpecialParametersTestClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The api version, which appears in the query, the value is always '2015-07-01-preview'. */ + private String apiVersion; + + /** + * Gets The api version, which appears in the query, the value is always '2015-07-01-preview'. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestAzureSpecialParametersTestClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestAzureSpecialParametersTestClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestAzureSpecialParametersTestClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The XMsClientRequestIds object to access its operations. + */ + private XMsClientRequestIds xMsClientRequestIds; + + /** + * Gets the XMsClientRequestIds object to access its operations. + * @return the XMsClientRequestIds object. + */ + public XMsClientRequestIds xMsClientRequestIds() { + return this.xMsClientRequestIds; + } + + /** + * The SubscriptionInCredentials object to access its operations. + */ + private SubscriptionInCredentials subscriptionInCredentials; + + /** + * Gets the SubscriptionInCredentials object to access its operations. + * @return the SubscriptionInCredentials object. + */ + public SubscriptionInCredentials subscriptionInCredentials() { + return this.subscriptionInCredentials; + } + + /** + * The SubscriptionInMethods object to access its operations. + */ + private SubscriptionInMethods subscriptionInMethods; + + /** + * Gets the SubscriptionInMethods object to access its operations. + * @return the SubscriptionInMethods object. + */ + public SubscriptionInMethods subscriptionInMethods() { + return this.subscriptionInMethods; + } + + /** + * The ApiVersionDefaults object to access its operations. + */ + private ApiVersionDefaults apiVersionDefaults; + + /** + * Gets the ApiVersionDefaults object to access its operations. + * @return the ApiVersionDefaults object. + */ + public ApiVersionDefaults apiVersionDefaults() { + return this.apiVersionDefaults; + } + + /** + * The ApiVersionLocals object to access its operations. + */ + private ApiVersionLocals apiVersionLocals; + + /** + * Gets the ApiVersionLocals object to access its operations. + * @return the ApiVersionLocals object. + */ + public ApiVersionLocals apiVersionLocals() { + return this.apiVersionLocals; + } + + /** + * The SkipUrlEncodings object to access its operations. + */ + private SkipUrlEncodings skipUrlEncodings; + + /** + * Gets the SkipUrlEncodings object to access its operations. + * @return the SkipUrlEncodings object. + */ + public SkipUrlEncodings skipUrlEncodings() { + return this.skipUrlEncodings; + } + + /** + * The Odatas object to access its operations. + */ + private Odatas odatas; + + /** + * Gets the Odatas object to access its operations. + * @return the Odatas object. + */ + public Odatas odatas() { + return this.odatas; + } + + /** + * The Headers object to access its operations. + */ + private Headers headers; + + /** + * Gets the Headers object to access its operations. + * @return the Headers object. + */ + public Headers headers() { + return this.headers; + } + + /** + * Initializes an instance of AutoRestAzureSpecialParametersTestClient client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestAzureSpecialParametersTestClientImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestAzureSpecialParametersTestClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestAzureSpecialParametersTestClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestAzureSpecialParametersTestClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestAzureSpecialParametersTestClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-07-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.xMsClientRequestIds = new XMsClientRequestIdsImpl(restClient().retrofit(), this); + this.subscriptionInCredentials = new SubscriptionInCredentialsImpl(restClient().retrofit(), this); + this.subscriptionInMethods = new SubscriptionInMethodsImpl(restClient().retrofit(), this); + this.apiVersionDefaults = new ApiVersionDefaultsImpl(restClient().retrofit(), this); + this.apiVersionLocals = new ApiVersionLocalsImpl(restClient().retrofit(), this); + this.skipUrlEncodings = new SkipUrlEncodingsImpl(restClient().retrofit(), this); + this.odatas = new OdatasImpl(restClient().retrofit(), this); + this.headers = new HeadersImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestAzureSpecialParametersTestClient", "2015-07-01-preview"); + } +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/HeadersImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/HeadersImpl.java new file mode 100644 index 0000000000..513941d1f4 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/HeadersImpl.java @@ -0,0 +1,294 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import fixtures.azurespecials.models.ErrorException; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdHeadHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdParamGroupingHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdParamGroupingParameters; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.HEAD; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Headers. + */ +public class HeadersImpl implements fixtures.azurespecials.Headers { + /** The Retrofit service to perform REST calls. */ + private HeadersService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of HeadersImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HeadersImpl(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(HeadersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Headers to be + * used by Retrofit to perform actually REST calls. + */ + interface HeadersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.Headers customNamedRequestId" }) + @POST("azurespecials/customNamedRequestId") + Observable> customNamedRequestId(@Header("foo-client-request-id") String fooClientRequestId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.Headers customNamedRequestIdParamGrouping" }) + @POST("azurespecials/customNamedRequestIdParamGrouping") + Observable> customNamedRequestIdParamGrouping(@Header("accept-language") String acceptLanguage, @Header("foo-client-request-id") String fooClientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.Headers customNamedRequestIdHead" }) + @HEAD("azurespecials/customNamedRequestIdHead") + Observable> customNamedRequestIdHead(@Header("foo-client-request-id") String fooClientRequestId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void customNamedRequestId(String fooClientRequestId) { + customNamedRequestIdWithServiceResponseAsync(fooClientRequestId).toBlocking().single().body(); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture customNamedRequestIdAsync(String fooClientRequestId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(customNamedRequestIdWithServiceResponseAsync(fooClientRequestId), serviceCallback); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable customNamedRequestIdAsync(String fooClientRequestId) { + return customNamedRequestIdWithServiceResponseAsync(fooClientRequestId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> customNamedRequestIdWithServiceResponseAsync(String fooClientRequestId) { + if (fooClientRequestId == null) { + throw new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null."); + } + return service.customNamedRequestId(fooClientRequestId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = customNamedRequestIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders customNamedRequestIdDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderCustomNamedRequestIdHeaders.class); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void customNamedRequestIdParamGrouping(HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters) { + customNamedRequestIdParamGroupingWithServiceResponseAsync(headerCustomNamedRequestIdParamGroupingParameters).toBlocking().single().body(); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture customNamedRequestIdParamGroupingAsync(HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(customNamedRequestIdParamGroupingWithServiceResponseAsync(headerCustomNamedRequestIdParamGroupingParameters), serviceCallback); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable customNamedRequestIdParamGroupingAsync(HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters) { + return customNamedRequestIdParamGroupingWithServiceResponseAsync(headerCustomNamedRequestIdParamGroupingParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> customNamedRequestIdParamGroupingWithServiceResponseAsync(HeaderCustomNamedRequestIdParamGroupingParameters headerCustomNamedRequestIdParamGroupingParameters) { + if (headerCustomNamedRequestIdParamGroupingParameters == null) { + throw new IllegalArgumentException("Parameter headerCustomNamedRequestIdParamGroupingParameters is required and cannot be null."); + } + Validator.validate(headerCustomNamedRequestIdParamGroupingParameters); + String fooClientRequestId = headerCustomNamedRequestIdParamGroupingParameters.fooClientRequestId(); + return service.customNamedRequestIdParamGrouping(this.client.acceptLanguage(), fooClientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = customNamedRequestIdParamGroupingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders customNamedRequestIdParamGroupingDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderCustomNamedRequestIdParamGroupingHeaders.class); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean customNamedRequestIdHead(String fooClientRequestId) { + return customNamedRequestIdHeadWithServiceResponseAsync(fooClientRequestId).toBlocking().single().body(); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture customNamedRequestIdHeadAsync(String fooClientRequestId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(customNamedRequestIdHeadWithServiceResponseAsync(fooClientRequestId), serviceCallback); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable customNamedRequestIdHeadAsync(String fooClientRequestId) { + return customNamedRequestIdHeadWithServiceResponseAsync(fooClientRequestId).map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> customNamedRequestIdHeadWithServiceResponseAsync(String fooClientRequestId) { + if (fooClientRequestId == null) { + throw new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null."); + } + return service.customNamedRequestIdHead(fooClientRequestId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = customNamedRequestIdHeadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders customNamedRequestIdHeadDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmptyWithHeaders(response, HeaderCustomNamedRequestIdHeadHeaders.class); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/OdatasImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/OdatasImpl.java new file mode 100644 index 0000000000..fdbbf139c5 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/OdatasImpl.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import fixtures.azurespecials.Odatas; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Odatas. + */ +public class OdatasImpl implements Odatas { + /** The Retrofit service to perform REST calls. */ + private OdatasService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of OdatasImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OdatasImpl(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(OdatasService.class); + this.client = client; + } + + /** + * The interface defining all the services for Odatas to be + * used by Retrofit to perform actually REST calls. + */ + interface OdatasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.Odatas getWithFilter" }) + @GET("azurespecials/odata/filter") + Observable> getWithFilter(@Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getWithFilter() { + getWithFilterWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getWithFilterAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithFilterWithServiceResponseAsync(), serviceCallback); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getWithFilterAsync() { + return getWithFilterWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithFilterWithServiceResponseAsync() { + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.getWithFilter(filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getWithFilterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getWithFilter(String filter, Integer top, String orderby) { + getWithFilterWithServiceResponseAsync(filter, top, orderby).toBlocking().single().body(); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getWithFilterAsync(String filter, Integer top, String orderby, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithFilterWithServiceResponseAsync(filter, top, orderby), serviceCallback); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getWithFilterAsync(String filter, Integer top, String orderby) { + return getWithFilterWithServiceResponseAsync(filter, top, orderby).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithFilterWithServiceResponseAsync(String filter, Integer top, String orderby) { + return service.getWithFilter(filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getWithFilterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getWithFilterDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/SkipUrlEncodingsImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/SkipUrlEncodingsImpl.java new file mode 100644 index 0000000000..5e0ea1225a --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/SkipUrlEncodingsImpl.java @@ -0,0 +1,635 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import fixtures.azurespecials.SkipUrlEncodings; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SkipUrlEncodings. + */ +public class SkipUrlEncodingsImpl implements SkipUrlEncodings { + /** The Retrofit service to perform REST calls. */ + private SkipUrlEncodingsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of SkipUrlEncodingsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SkipUrlEncodingsImpl(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(SkipUrlEncodingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SkipUrlEncodings to be + * used by Retrofit to perform actually REST calls. + */ + interface SkipUrlEncodingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getMethodPathValid" }) + @GET("azurespecials/skipUrlEncoding/method/path/valid/{unencodedPathParam}") + Observable> getMethodPathValid(@Path(value = "unencodedPathParam", encoded = true) String unencodedPathParam, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getPathPathValid" }) + @GET("azurespecials/skipUrlEncoding/path/path/valid/{unencodedPathParam}") + Observable> getPathPathValid(@Path(value = "unencodedPathParam", encoded = true) String unencodedPathParam, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getSwaggerPathValid" }) + @GET("azurespecials/skipUrlEncoding/swagger/path/valid/{unencodedPathParam}") + Observable> getSwaggerPathValid(@Path(value = "unencodedPathParam", encoded = true) String unencodedPathParam, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getMethodQueryValid" }) + @GET("azurespecials/skipUrlEncoding/method/query/valid") + Observable> getMethodQueryValid(@Query(value = "q1", encoded = true) String q1, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getMethodQueryNull" }) + @GET("azurespecials/skipUrlEncoding/method/query/null") + Observable> getMethodQueryNull(@Query(value = "q1", encoded = true) String q1, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getPathQueryValid" }) + @GET("azurespecials/skipUrlEncoding/path/query/valid") + Observable> getPathQueryValid(@Query(value = "q1", encoded = true) String q1, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getSwaggerQueryValid" }) + @GET("azurespecials/skipUrlEncoding/swagger/query/valid") + Observable> getSwaggerQueryValid(@Query(value = "q1", encoded = true) String q1, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodPathValid(String unencodedPathParam) { + getMethodPathValidWithServiceResponseAsync(unencodedPathParam).toBlocking().single().body(); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodPathValidAsync(String unencodedPathParam, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodPathValidWithServiceResponseAsync(unencodedPathParam), serviceCallback); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodPathValidAsync(String unencodedPathParam) { + return getMethodPathValidWithServiceResponseAsync(unencodedPathParam).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodPathValidWithServiceResponseAsync(String unencodedPathParam) { + if (unencodedPathParam == null) { + throw new IllegalArgumentException("Parameter unencodedPathParam is required and cannot be null."); + } + return service.getMethodPathValid(unencodedPathParam, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodPathValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodPathValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getPathPathValid(String unencodedPathParam) { + getPathPathValidWithServiceResponseAsync(unencodedPathParam).toBlocking().single().body(); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPathPathValidAsync(String unencodedPathParam, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPathPathValidWithServiceResponseAsync(unencodedPathParam), serviceCallback); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getPathPathValidAsync(String unencodedPathParam) { + return getPathPathValidWithServiceResponseAsync(unencodedPathParam).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getPathPathValidWithServiceResponseAsync(String unencodedPathParam) { + if (unencodedPathParam == null) { + throw new IllegalArgumentException("Parameter unencodedPathParam is required and cannot be null."); + } + return service.getPathPathValid(unencodedPathParam, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPathPathValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPathPathValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getSwaggerPathValid() { + getSwaggerPathValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSwaggerPathValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSwaggerPathValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getSwaggerPathValidAsync() { + return getSwaggerPathValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getSwaggerPathValidWithServiceResponseAsync() { + final String unencodedPathParam = "path1/path2/path3"; + return service.getSwaggerPathValid(unencodedPathParam, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSwaggerPathValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSwaggerPathValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodQueryValid(String q1) { + getMethodQueryValidWithServiceResponseAsync(q1).toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodQueryValidAsync(String q1, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodQueryValidWithServiceResponseAsync(q1), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodQueryValidAsync(String q1) { + return getMethodQueryValidWithServiceResponseAsync(q1).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodQueryValidWithServiceResponseAsync(String q1) { + if (q1 == null) { + throw new IllegalArgumentException("Parameter q1 is required and cannot be null."); + } + return service.getMethodQueryValid(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodQueryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodQueryValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodQueryNull() { + getMethodQueryNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodQueryNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodQueryNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodQueryNullAsync() { + return getMethodQueryNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodQueryNullWithServiceResponseAsync() { + final String q1 = null; + return service.getMethodQueryNull(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodQueryNull(String q1) { + getMethodQueryNullWithServiceResponseAsync(q1).toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodQueryNullAsync(String q1, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodQueryNullWithServiceResponseAsync(q1), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodQueryNullAsync(String q1) { + return getMethodQueryNullWithServiceResponseAsync(q1).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodQueryNullWithServiceResponseAsync(String q1) { + return service.getMethodQueryNull(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodQueryNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getPathQueryValid(String q1) { + getPathQueryValidWithServiceResponseAsync(q1).toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPathQueryValidAsync(String q1, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPathQueryValidWithServiceResponseAsync(q1), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getPathQueryValidAsync(String q1) { + return getPathQueryValidWithServiceResponseAsync(q1).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getPathQueryValidWithServiceResponseAsync(String q1) { + if (q1 == null) { + throw new IllegalArgumentException("Parameter q1 is required and cannot be null."); + } + return service.getPathQueryValid(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPathQueryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPathQueryValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getSwaggerQueryValid() { + getSwaggerQueryValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSwaggerQueryValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSwaggerQueryValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getSwaggerQueryValidAsync() { + return getSwaggerQueryValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getSwaggerQueryValidWithServiceResponseAsync() { + final String q1 = "value1&q2=value2&q3=value3"; + return service.getSwaggerQueryValid(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSwaggerQueryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSwaggerQueryValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/SubscriptionInCredentialsImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/SubscriptionInCredentialsImpl.java new file mode 100644 index 0000000000..2f826c4d1b --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/SubscriptionInCredentialsImpl.java @@ -0,0 +1,422 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import fixtures.azurespecials.SubscriptionInCredentials; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SubscriptionInCredentials. + */ +public class SubscriptionInCredentialsImpl implements SubscriptionInCredentials { + /** The Retrofit service to perform REST calls. */ + private SubscriptionInCredentialsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of SubscriptionInCredentialsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubscriptionInCredentialsImpl(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(SubscriptionInCredentialsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SubscriptionInCredentials to be + * used by Retrofit to perform actually REST calls. + */ + interface SubscriptionInCredentialsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postMethodGlobalValid" }) + @POST("azurespecials/subscriptionId/method/string/none/path/global/1234-5678-9012-3456/{subscriptionId}") + Observable> postMethodGlobalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postMethodGlobalNull" }) + @POST("azurespecials/subscriptionId/method/string/none/path/global/null/{subscriptionId}") + Observable> postMethodGlobalNull(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postMethodGlobalNotProvidedValid" }) + @POST("azurespecials/subscriptionId/method/string/none/path/globalNotProvided/1234-5678-9012-3456/{subscriptionId}") + Observable> postMethodGlobalNotProvidedValid(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postPathGlobalValid" }) + @POST("azurespecials/subscriptionId/path/string/none/path/global/1234-5678-9012-3456/{subscriptionId}") + Observable> postPathGlobalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postSwaggerGlobalValid" }) + @POST("azurespecials/subscriptionId/swagger/string/none/path/global/1234-5678-9012-3456/{subscriptionId}") + Observable> postSwaggerGlobalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodGlobalValid() { + postMethodGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodGlobalValidAsync() { + return postMethodGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodGlobalValidWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.postMethodGlobalValid(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodGlobalNull() { + postMethodGlobalNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodGlobalNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodGlobalNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodGlobalNullAsync() { + return postMethodGlobalNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodGlobalNullWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.postMethodGlobalNull(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodGlobalNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodGlobalNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodGlobalNotProvidedValid() { + postMethodGlobalNotProvidedValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodGlobalNotProvidedValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodGlobalNotProvidedValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodGlobalNotProvidedValidAsync() { + return postMethodGlobalNotProvidedValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodGlobalNotProvidedValidWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.postMethodGlobalNotProvidedValid(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodGlobalNotProvidedValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodGlobalNotProvidedValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postPathGlobalValid() { + postPathGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postPathGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postPathGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postPathGlobalValidAsync() { + return postPathGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postPathGlobalValidWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.postPathGlobalValid(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postPathGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postPathGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postSwaggerGlobalValid() { + postSwaggerGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postSwaggerGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postSwaggerGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postSwaggerGlobalValidAsync() { + return postSwaggerGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postSwaggerGlobalValidWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.postSwaggerGlobalValid(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postSwaggerGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postSwaggerGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/SubscriptionInMethodsImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/SubscriptionInMethodsImpl.java new file mode 100644 index 0000000000..a362cff314 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/SubscriptionInMethodsImpl.java @@ -0,0 +1,362 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import fixtures.azurespecials.SubscriptionInMethods; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SubscriptionInMethods. + */ +public class SubscriptionInMethodsImpl implements SubscriptionInMethods { + /** The Retrofit service to perform REST calls. */ + private SubscriptionInMethodsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of SubscriptionInMethodsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubscriptionInMethodsImpl(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(SubscriptionInMethodsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SubscriptionInMethods to be + * used by Retrofit to perform actually REST calls. + */ + interface SubscriptionInMethodsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInMethods postMethodLocalValid" }) + @POST("azurespecials/subscriptionId/method/string/none/path/local/1234-5678-9012-3456/{subscriptionId}") + Observable> postMethodLocalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInMethods postMethodLocalNull" }) + @POST("azurespecials/subscriptionId/method/string/none/path/local/null/{subscriptionId}") + Observable> postMethodLocalNull(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInMethods postPathLocalValid" }) + @POST("azurespecials/subscriptionId/path/string/none/path/local/1234-5678-9012-3456/{subscriptionId}") + Observable> postPathLocalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInMethods postSwaggerLocalValid" }) + @POST("azurespecials/subscriptionId/swagger/string/none/path/local/1234-5678-9012-3456/{subscriptionId}") + Observable> postSwaggerLocalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodLocalValid(String subscriptionId) { + postMethodLocalValidWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodLocalValidWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodLocalValidAsync(String subscriptionId) { + return postMethodLocalValidWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodLocalValidWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + return service.postMethodLocalValid(subscriptionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodLocalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodLocalNull(String subscriptionId) { + postMethodLocalNullWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodLocalNullAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodLocalNullWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodLocalNullAsync(String subscriptionId) { + return postMethodLocalNullWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodLocalNullWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + return service.postMethodLocalNull(subscriptionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodLocalNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodLocalNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postPathLocalValid(String subscriptionId) { + postPathLocalValidWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postPathLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postPathLocalValidWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postPathLocalValidAsync(String subscriptionId) { + return postPathLocalValidWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postPathLocalValidWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + return service.postPathLocalValid(subscriptionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postPathLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postPathLocalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postSwaggerLocalValid(String subscriptionId) { + postSwaggerLocalValidWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postSwaggerLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postSwaggerLocalValidWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postSwaggerLocalValidAsync(String subscriptionId) { + return postSwaggerLocalValidWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postSwaggerLocalValidWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + return service.postSwaggerLocalValid(subscriptionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postSwaggerLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postSwaggerLocalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/XMsClientRequestIdsImpl.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/XMsClientRequestIdsImpl.java new file mode 100644 index 0000000000..a3a64d2aba --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/XMsClientRequestIdsImpl.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import fixtures.azurespecials.XMsClientRequestIds; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in XMsClientRequestIds. + */ +public class XMsClientRequestIdsImpl implements XMsClientRequestIds { + /** The Retrofit service to perform REST calls. */ + private XMsClientRequestIdsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of XMsClientRequestIdsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public XMsClientRequestIdsImpl(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(XMsClientRequestIdsService.class); + this.client = client; + } + + /** + * The interface defining all the services for XMsClientRequestIds to be + * used by Retrofit to perform actually REST calls. + */ + interface XMsClientRequestIdsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.XMsClientRequestIds get" }) + @GET("azurespecials/overwrite/x-ms-client-request-id/method/") + Observable> get(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.XMsClientRequestIds paramGet" }) + @GET("azurespecials/overwrite/x-ms-client-request-id/via-param/method/") + Observable> paramGet(@Header("x-ms-client-request-id") String xMsClientRequestId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get() { + getWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getAsync() { + return getWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithServiceResponseAsync() { + return service.get(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramGet(String xMsClientRequestId) { + paramGetWithServiceResponseAsync(xMsClientRequestId).toBlocking().single().body(); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramGetAsync(String xMsClientRequestId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramGetWithServiceResponseAsync(xMsClientRequestId), serviceCallback); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramGetAsync(String xMsClientRequestId) { + return paramGetWithServiceResponseAsync(xMsClientRequestId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramGetWithServiceResponseAsync(String xMsClientRequestId) { + if (xMsClientRequestId == null) { + throw new IllegalArgumentException("Parameter xMsClientRequestId is required and cannot be null."); + } + return service.paramGet(xMsClientRequestId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramGetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramGetDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/implementation/package-info.java b/test/azure/src/main/java/fixtures/azurespecials/implementation/package-info.java new file mode 100644 index 0000000000..141f0e35d6 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestAzureSpecialParametersTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurespecials.implementation; diff --git a/test/azure/src/main/java/fixtures/azurespecials/models/Error.java b/test/azure/src/main/java/fixtures/azurespecials/models/Error.java new file mode 100644 index 0000000000..cb8c67a70b --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/models/Error.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The constantId property. + */ + @JsonProperty(value = "constantId") + private Integer constantId; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the constantId value. + * + * @return the constantId value + */ + public Integer constantId() { + return this.constantId; + } + + /** + * Set the constantId value. + * + * @param constantId the constantId value to set + * @return the Error object itself. + */ + public Error withConstantId(Integer constantId) { + this.constantId = constantId; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/models/ErrorException.java b/test/azure/src/main/java/fixtures/azurespecials/models/ErrorException.java new file mode 100644 index 0000000000..5108260da3 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdHeadHeaders.java b/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdHeadHeaders.java new file mode 100644 index 0000000000..95c352a29b --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdHeadHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for customNamedRequestIdHead operation. + */ +public class HeaderCustomNamedRequestIdHeadHeaders { + /** + * Gets the foo-request-id. + */ + @JsonProperty(value = "foo-request-id") + private String fooRequestId; + + /** + * Get the fooRequestId value. + * + * @return the fooRequestId value + */ + public String fooRequestId() { + return this.fooRequestId; + } + + /** + * Set the fooRequestId value. + * + * @param fooRequestId the fooRequestId value to set + * @return the HeaderCustomNamedRequestIdHeadHeaders object itself. + */ + public HeaderCustomNamedRequestIdHeadHeaders withFooRequestId(String fooRequestId) { + this.fooRequestId = fooRequestId; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdHeaders.java b/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdHeaders.java new file mode 100644 index 0000000000..60989579d6 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for customNamedRequestId operation. + */ +public class HeaderCustomNamedRequestIdHeaders { + /** + * Gets the foo-request-id. + */ + @JsonProperty(value = "foo-request-id") + private String fooRequestId; + + /** + * Get the fooRequestId value. + * + * @return the fooRequestId value + */ + public String fooRequestId() { + return this.fooRequestId; + } + + /** + * Set the fooRequestId value. + * + * @param fooRequestId the fooRequestId value to set + * @return the HeaderCustomNamedRequestIdHeaders object itself. + */ + public HeaderCustomNamedRequestIdHeaders withFooRequestId(String fooRequestId) { + this.fooRequestId = fooRequestId; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdParamGroupingHeaders.java b/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdParamGroupingHeaders.java new file mode 100644 index 0000000000..d00cf48001 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdParamGroupingHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for customNamedRequestIdParamGrouping operation. + */ +public class HeaderCustomNamedRequestIdParamGroupingHeaders { + /** + * Gets the foo-request-id. + */ + @JsonProperty(value = "foo-request-id") + private String fooRequestId; + + /** + * Get the fooRequestId value. + * + * @return the fooRequestId value + */ + public String fooRequestId() { + return this.fooRequestId; + } + + /** + * Set the fooRequestId value. + * + * @param fooRequestId the fooRequestId value to set + * @return the HeaderCustomNamedRequestIdParamGroupingHeaders object itself. + */ + public HeaderCustomNamedRequestIdParamGroupingHeaders withFooRequestId(String fooRequestId) { + this.fooRequestId = fooRequestId; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdParamGroupingParameters.java b/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdParamGroupingParameters.java new file mode 100644 index 0000000000..94bfdf9cf9 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/models/HeaderCustomNamedRequestIdParamGroupingParameters.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for customNamedRequestIdParamGrouping operation. + */ +public class HeaderCustomNamedRequestIdParamGroupingParameters { + /** + * The fooRequestId. + */ + @JsonProperty(value = "", required = true) + private String fooClientRequestId; + + /** + * Get the fooClientRequestId value. + * + * @return the fooClientRequestId value + */ + public String fooClientRequestId() { + return this.fooClientRequestId; + } + + /** + * Set the fooClientRequestId value. + * + * @param fooClientRequestId the fooClientRequestId value to set + * @return the HeaderCustomNamedRequestIdParamGroupingParameters object itself. + */ + public HeaderCustomNamedRequestIdParamGroupingParameters withFooClientRequestId(String fooClientRequestId) { + this.fooClientRequestId = fooClientRequestId; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/models/OdataFilter.java b/test/azure/src/main/java/fixtures/azurespecials/models/OdataFilter.java new file mode 100644 index 0000000000..822d2d24cb --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/models/OdataFilter.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OdataFilter model. + */ +public class OdataFilter { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the OdataFilter object itself. + */ + public OdataFilter withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the OdataFilter object itself. + */ + public OdataFilter withName(String name) { + this.name = name; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/azurespecials/models/package-info.java b/test/azure/src/main/java/fixtures/azurespecials/models/package-info.java new file mode 100644 index 0000000000..477570c1b5 --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestAzureSpecialParametersTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurespecials.models; diff --git a/test/azure/src/main/java/fixtures/azurespecials/package-info.java b/test/azure/src/main/java/fixtures/azurespecials/package-info.java new file mode 100644 index 0000000000..414b194aae --- /dev/null +++ b/test/azure/src/main/java/fixtures/azurespecials/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestAzureSpecialParametersTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurespecials; diff --git a/test/azure/src/main/java/fixtures/custombaseuri/AutoRestParameterizedHostTestClient.java b/test/azure/src/main/java/fixtures/custombaseuri/AutoRestParameterizedHostTestClient.java new file mode 100644 index 0000000000..ce208ca225 --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/AutoRestParameterizedHostTestClient.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestParameterizedHostTestClient class. + */ +public interface AutoRestParameterizedHostTestClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets A string value that is used as a global part of the parameterized host. + * + * @return the host value. + */ + String host(); + + /** + * Sets A string value that is used as a global part of the parameterized host. + * + * @param host the host value. + * @return the service client itself + */ + AutoRestParameterizedHostTestClient withHost(String host); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestParameterizedHostTestClient withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestParameterizedHostTestClient withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestParameterizedHostTestClient withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Paths object to access its operations. + * @return the Paths object. + */ + Paths paths(); + +} diff --git a/test/azure/src/main/java/fixtures/custombaseuri/Paths.java b/test/azure/src/main/java/fixtures/custombaseuri/Paths.java new file mode 100644 index 0000000000..9ee241bf70 --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/Paths.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.custombaseuri.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public interface Paths { + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getEmpty(String accountName); + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(String accountName, final ServiceCallback serviceCallback); + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getEmptyAsync(String accountName); + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getEmptyWithServiceResponseAsync(String accountName); + +} diff --git a/test/azure/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java b/test/azure/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java new file mode 100644 index 0000000000..8e8815e6e8 --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import fixtures.custombaseuri.AutoRestParameterizedHostTestClient; +import fixtures.custombaseuri.Paths; + +/** + * Initializes a new instance of the AutoRestParameterizedHostTestClientImpl class. + */ +public class AutoRestParameterizedHostTestClientImpl extends AzureServiceClient implements AutoRestParameterizedHostTestClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** A string value that is used as a global part of the parameterized host. */ + private String host; + + /** + * Gets A string value that is used as a global part of the parameterized host. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Sets A string value that is used as a global part of the parameterized host. + * + * @param host the host value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withHost(String host) { + this.host = host; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Paths object to access its operations. + */ + private Paths paths; + + /** + * Gets the Paths object to access its operations. + * @return the Paths object. + */ + public Paths paths() { + return this.paths; + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestParameterizedHostTestClientImpl(ServiceClientCredentials credentials) { + this("http://{accountName}{host}", credentials); + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private AutoRestParameterizedHostTestClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestParameterizedHostTestClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.host = "host"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.paths = new PathsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestParameterizedHostTestClient", "1.0.0"); + } +} diff --git a/test/azure/src/main/java/fixtures/custombaseuri/implementation/PathsImpl.java b/test/azure/src/main/java/fixtures/custombaseuri/implementation/PathsImpl.java new file mode 100644 index 0000000000..fba26cacdd --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/implementation/PathsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.implementation; + +import retrofit2.Retrofit; +import fixtures.custombaseuri.Paths; +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.custombaseuri.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public class PathsImpl implements Paths { + /** The Retrofit service to perform REST calls. */ + private PathsService service; + /** The service client containing this operation class. */ + private AutoRestParameterizedHostTestClientImpl client; + + /** + * Initializes an instance of PathsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PathsImpl(Retrofit retrofit, AutoRestParameterizedHostTestClientImpl client) { + this.service = retrofit.create(PathsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Paths to be + * used by Retrofit to perform actually REST calls. + */ + interface PathsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.custombaseuri.Paths getEmpty" }) + @GET("customuri") + Observable> getEmpty(@Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getEmpty(String accountName) { + getEmptyWithServiceResponseAsync(accountName).toBlocking().single().body(); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(accountName), serviceCallback); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getEmptyAsync(String accountName) { + return getEmptyWithServiceResponseAsync(accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getEmptyWithServiceResponseAsync(String accountName) { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.host() == null) { + throw new IllegalArgumentException("Parameter this.client.host() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{accountName}", accountName, "{host}", this.client.host()); + return service.getEmpty(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/custombaseuri/implementation/package-info.java b/test/azure/src/main/java/fixtures/custombaseuri/implementation/package-info.java new file mode 100644 index 0000000000..9449c1aeeb --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestParameterizedHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseuri.implementation; diff --git a/test/azure/src/main/java/fixtures/custombaseuri/models/Error.java b/test/azure/src/main/java/fixtures/custombaseuri/models/Error.java new file mode 100644 index 0000000000..1b960f8dd2 --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/custombaseuri/models/ErrorException.java b/test/azure/src/main/java/fixtures/custombaseuri/models/ErrorException.java new file mode 100644 index 0000000000..8ecc6a0460 --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azure/src/main/java/fixtures/custombaseuri/models/package-info.java b/test/azure/src/main/java/fixtures/custombaseuri/models/package-info.java new file mode 100644 index 0000000000..22f43a6215 --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestParameterizedHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseuri.models; diff --git a/test/azure/src/main/java/fixtures/custombaseuri/package-info.java b/test/azure/src/main/java/fixtures/custombaseuri/package-info.java new file mode 100644 index 0000000000..b604c7cd9f --- /dev/null +++ b/test/azure/src/main/java/fixtures/custombaseuri/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestParameterizedHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseuri; diff --git a/test/azure/src/main/java/fixtures/head/AutoRestHeadTestService.java b/test/azure/src/main/java/fixtures/head/AutoRestHeadTestService.java new file mode 100644 index 0000000000..b478391641 --- /dev/null +++ b/test/azure/src/main/java/fixtures/head/AutoRestHeadTestService.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.head; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestHeadTestService class. + */ +public interface AutoRestHeadTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestHeadTestService withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestHeadTestService withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestHeadTestService withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the HttpSuccess object to access its operations. + * @return the HttpSuccess object. + */ + HttpSuccess httpSuccess(); + +} diff --git a/test/azure/src/main/java/fixtures/head/HttpSuccess.java b/test/azure/src/main/java/fixtures/head/HttpSuccess.java new file mode 100644 index 0000000000..e2e45f638b --- /dev/null +++ b/test/azure/src/main/java/fixtures/head/HttpSuccess.java @@ -0,0 +1,130 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.head; + +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpSuccess. + */ +public interface HttpSuccess { + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean head200(); + + /** + * Return 200 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head200Async(final ServiceCallback serviceCallback); + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable head200Async(); + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> head200WithServiceResponseAsync(); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean head204(); + + /** + * Return 204 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head204Async(final ServiceCallback serviceCallback); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable head204Async(); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> head204WithServiceResponseAsync(); + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean head404(); + + /** + * Return 404 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head404Async(final ServiceCallback serviceCallback); + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable head404Async(); + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> head404WithServiceResponseAsync(); + +} diff --git a/test/azure/src/main/java/fixtures/head/implementation/AutoRestHeadTestServiceImpl.java b/test/azure/src/main/java/fixtures/head/implementation/AutoRestHeadTestServiceImpl.java new file mode 100644 index 0000000000..8dfc07d214 --- /dev/null +++ b/test/azure/src/main/java/fixtures/head/implementation/AutoRestHeadTestServiceImpl.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.head.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import fixtures.head.AutoRestHeadTestService; +import fixtures.head.HttpSuccess; + +/** + * Initializes a new instance of the AutoRestHeadTestServiceImpl class. + */ +public class AutoRestHeadTestServiceImpl extends AzureServiceClient implements AutoRestHeadTestService { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestHeadTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestHeadTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestHeadTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The HttpSuccess object to access its operations. + */ + private HttpSuccess httpSuccess; + + /** + * Gets the HttpSuccess object to access its operations. + * @return the HttpSuccess object. + */ + public HttpSuccess httpSuccess() { + return this.httpSuccess; + } + + /** + * Initializes an instance of AutoRestHeadTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestHeadTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestHeadTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestHeadTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestHeadTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestHeadTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.httpSuccess = new HttpSuccessImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestHeadTestService", "1.0.0"); + } +} diff --git a/test/azure/src/main/java/fixtures/head/implementation/HttpSuccessImpl.java b/test/azure/src/main/java/fixtures/head/implementation/HttpSuccessImpl.java new file mode 100644 index 0000000000..45ab823942 --- /dev/null +++ b/test/azure/src/main/java/fixtures/head/implementation/HttpSuccessImpl.java @@ -0,0 +1,269 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.head.implementation; + +import retrofit2.Retrofit; +import fixtures.head.HttpSuccess; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import retrofit2.http.HEAD; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpSuccess. + */ +public class HttpSuccessImpl implements HttpSuccess { + /** The Retrofit service to perform REST calls. */ + private HttpSuccessService service; + /** The service client containing this operation class. */ + private AutoRestHeadTestServiceImpl client; + + /** + * Initializes an instance of HttpSuccessImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HttpSuccessImpl(Retrofit retrofit, AutoRestHeadTestServiceImpl client) { + this.service = retrofit.create(HttpSuccessService.class); + this.client = client; + } + + /** + * The interface defining all the services for HttpSuccess to be + * used by Retrofit to perform actually REST calls. + */ + interface HttpSuccessService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.head.HttpSuccess head200" }) + @HEAD("http/success/200") + Observable> head200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.head.HttpSuccess head204" }) + @HEAD("http/success/204") + Observable> head204(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.head.HttpSuccess head404" }) + @HEAD("http/success/404") + Observable> head404(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean head200() { + return head200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 200 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable head200Async() { + return head200WithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> head200WithServiceResponseAsync() { + return service.head200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean head204() { + return head204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 204 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable head204Async() { + return head204WithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> head204WithServiceResponseAsync() { + return service.head204(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean head404() { + return head404WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 404 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head404Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head404WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable head404Async() { + return head404WithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> head404WithServiceResponseAsync() { + return service.head404(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head404Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head404Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/head/implementation/package-info.java b/test/azure/src/main/java/fixtures/head/implementation/package-info.java new file mode 100644 index 0000000000..d058ca5a28 --- /dev/null +++ b/test/azure/src/main/java/fixtures/head/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestHeadTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.head.implementation; diff --git a/test/azure/src/main/java/fixtures/head/models/package-info.java b/test/azure/src/main/java/fixtures/head/models/package-info.java new file mode 100644 index 0000000000..5d7b910144 --- /dev/null +++ b/test/azure/src/main/java/fixtures/head/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestHeadTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.head.models; diff --git a/test/azure/src/main/java/fixtures/head/package-info.java b/test/azure/src/main/java/fixtures/head/package-info.java new file mode 100644 index 0000000000..0569c93961 --- /dev/null +++ b/test/azure/src/main/java/fixtures/head/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestHeadTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.head; diff --git a/test/azure/src/main/java/fixtures/headexceptions/AutoRestHeadExceptionTestService.java b/test/azure/src/main/java/fixtures/headexceptions/AutoRestHeadExceptionTestService.java new file mode 100644 index 0000000000..5e5cdfac5b --- /dev/null +++ b/test/azure/src/main/java/fixtures/headexceptions/AutoRestHeadExceptionTestService.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.headexceptions; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestHeadExceptionTestService class. + */ +public interface AutoRestHeadExceptionTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestHeadExceptionTestService withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestHeadExceptionTestService withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestHeadExceptionTestService withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the HeadExceptions object to access its operations. + * @return the HeadExceptions object. + */ + HeadExceptions headExceptions(); + +} diff --git a/test/azure/src/main/java/fixtures/headexceptions/HeadExceptions.java b/test/azure/src/main/java/fixtures/headexceptions/HeadExceptions.java new file mode 100644 index 0000000000..dcf57f31a5 --- /dev/null +++ b/test/azure/src/main/java/fixtures/headexceptions/HeadExceptions.java @@ -0,0 +1,127 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.headexceptions; + +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HeadExceptions. + */ +public interface HeadExceptions { + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head200(); + + /** + * Return 200 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head200Async(final ServiceCallback serviceCallback); + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable head200Async(); + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> head200WithServiceResponseAsync(); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head204(); + + /** + * Return 204 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head204Async(final ServiceCallback serviceCallback); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable head204Async(); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> head204WithServiceResponseAsync(); + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head404(); + + /** + * Return 404 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head404Async(final ServiceCallback serviceCallback); + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable head404Async(); + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> head404WithServiceResponseAsync(); + +} diff --git a/test/azure/src/main/java/fixtures/headexceptions/implementation/AutoRestHeadExceptionTestServiceImpl.java b/test/azure/src/main/java/fixtures/headexceptions/implementation/AutoRestHeadExceptionTestServiceImpl.java new file mode 100644 index 0000000000..4a8b01f734 --- /dev/null +++ b/test/azure/src/main/java/fixtures/headexceptions/implementation/AutoRestHeadExceptionTestServiceImpl.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.headexceptions.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import fixtures.headexceptions.AutoRestHeadExceptionTestService; +import fixtures.headexceptions.HeadExceptions; + +/** + * Initializes a new instance of the AutoRestHeadExceptionTestServiceImpl class. + */ +public class AutoRestHeadExceptionTestServiceImpl extends AzureServiceClient implements AutoRestHeadExceptionTestService { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestHeadExceptionTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestHeadExceptionTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestHeadExceptionTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The HeadExceptions object to access its operations. + */ + private HeadExceptions headExceptions; + + /** + * Gets the HeadExceptions object to access its operations. + * @return the HeadExceptions object. + */ + public HeadExceptions headExceptions() { + return this.headExceptions; + } + + /** + * Initializes an instance of AutoRestHeadExceptionTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestHeadExceptionTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestHeadExceptionTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestHeadExceptionTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestHeadExceptionTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestHeadExceptionTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.headExceptions = new HeadExceptionsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestHeadExceptionTestService", "1.0.0"); + } +} diff --git a/test/azure/src/main/java/fixtures/headexceptions/implementation/HeadExceptionsImpl.java b/test/azure/src/main/java/fixtures/headexceptions/implementation/HeadExceptionsImpl.java new file mode 100644 index 0000000000..5153cf4b4d --- /dev/null +++ b/test/azure/src/main/java/fixtures/headexceptions/implementation/HeadExceptionsImpl.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.headexceptions.implementation; + +import retrofit2.Retrofit; +import fixtures.headexceptions.HeadExceptions; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import retrofit2.http.HEAD; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HeadExceptions. + */ +public class HeadExceptionsImpl implements HeadExceptions { + /** The Retrofit service to perform REST calls. */ + private HeadExceptionsService service; + /** The service client containing this operation class. */ + private AutoRestHeadExceptionTestServiceImpl client; + + /** + * Initializes an instance of HeadExceptionsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HeadExceptionsImpl(Retrofit retrofit, AutoRestHeadExceptionTestServiceImpl client) { + this.service = retrofit.create(HeadExceptionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HeadExceptions to be + * used by Retrofit to perform actually REST calls. + */ + interface HeadExceptionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.headexceptions.HeadExceptions head200" }) + @HEAD("http/success/200") + Observable> head200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.headexceptions.HeadExceptions head204" }) + @HEAD("http/success/204") + Observable> head204(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.headexceptions.HeadExceptions head404" }) + @HEAD("http/success/404") + Observable> head404(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head200() { + head200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 200 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head200Async() { + return head200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head200WithServiceResponseAsync() { + return service.head200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head204() { + head204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 204 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head204Async() { + return head204WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head204WithServiceResponseAsync() { + return service.head204(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head404() { + head404WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 404 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head404Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head404WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head404Async() { + return head404WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head404WithServiceResponseAsync() { + return service.head404(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head404Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head404Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/headexceptions/implementation/package-info.java b/test/azure/src/main/java/fixtures/headexceptions/implementation/package-info.java new file mode 100644 index 0000000000..db31cf72cf --- /dev/null +++ b/test/azure/src/main/java/fixtures/headexceptions/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestHeadExceptionTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.headexceptions.implementation; diff --git a/test/azure/src/main/java/fixtures/headexceptions/models/package-info.java b/test/azure/src/main/java/fixtures/headexceptions/models/package-info.java new file mode 100644 index 0000000000..6524f78af9 --- /dev/null +++ b/test/azure/src/main/java/fixtures/headexceptions/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestHeadExceptionTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.headexceptions.models; diff --git a/test/azure/src/main/java/fixtures/headexceptions/package-info.java b/test/azure/src/main/java/fixtures/headexceptions/package-info.java new file mode 100644 index 0000000000..3847d55918 --- /dev/null +++ b/test/azure/src/main/java/fixtures/headexceptions/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestHeadExceptionTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.headexceptions; diff --git a/test/azure/src/main/java/fixtures/lro/AutoRestLongRunningOperationTestService.java b/test/azure/src/main/java/fixtures/lro/AutoRestLongRunningOperationTestService.java new file mode 100644 index 0000000000..bbac790025 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/AutoRestLongRunningOperationTestService.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestLongRunningOperationTestService class. + */ +public interface AutoRestLongRunningOperationTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestLongRunningOperationTestService withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestLongRunningOperationTestService withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestLongRunningOperationTestService withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the LROs object to access its operations. + * @return the LROs object. + */ + LROs lROs(); + + /** + * Gets the LRORetrys object to access its operations. + * @return the LRORetrys object. + */ + LRORetrys lRORetrys(); + + /** + * Gets the LROSADs object to access its operations. + * @return the LROSADs object. + */ + LROSADs lROSADs(); + + /** + * Gets the LROsCustomHeaders object to access its operations. + * @return the LROsCustomHeaders object. + */ + LROsCustomHeaders lROsCustomHeaders(); + +} diff --git a/test/azure/src/main/java/fixtures/lro/LRORetrys.java b/test/azure/src/main/java/fixtures/lro/LRORetrys.java new file mode 100644 index 0000000000..777b1283d1 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/LRORetrys.java @@ -0,0 +1,815 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro; + +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.lro.models.LRORetrysDelete202Retry200Headers; +import fixtures.lro.models.LRORetrysDeleteAsyncRelativeRetrySucceededHeaders; +import fixtures.lro.models.LRORetrysDeleteProvisioning202Accepted200SucceededHeaders; +import fixtures.lro.models.LRORetrysPost202Retry200Headers; +import fixtures.lro.models.LRORetrysPostAsyncRelativeRetrySucceededHeaders; +import fixtures.lro.models.LRORetrysPutAsyncRelativeRetrySucceededHeaders; +import fixtures.lro.models.Product; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LRORetrys. + */ +public interface LRORetrys { + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put201CreatingSucceeded200(); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put201CreatingSucceeded200Async(); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put201CreatingSucceeded200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put201CreatingSucceeded200(Product product); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put201CreatingSucceeded200Async(Product product); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put201CreatingSucceeded200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut201CreatingSucceeded200(); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut201CreatingSucceeded200Async(); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut201CreatingSucceeded200(Product product); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut201CreatingSucceeded200Async(Product product); + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetrySucceeded(); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetrySucceededAsync(); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetrySucceededWithServiceResponseAsync(); + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetrySucceeded(Product product); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetrySucceededAsync(Product product); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetrySucceeded(); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetrySucceededAsync(); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(); + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetrySucceeded(Product product); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetrySucceededAsync(Product product); + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product deleteProvisioning202Accepted200Succeeded(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable deleteProvisioning202Accepted200SucceededAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> deleteProvisioning202Accepted200SucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginDeleteProvisioning202Accepted200Succeeded(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginDeleteProvisioning202Accepted200SucceededAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete202Retry200(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable delete202Retry200Async(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> delete202Retry200WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDelete202Retry200(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDelete202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDelete202Retry200Async(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDelete202Retry200WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncRelativeRetrySucceeded(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncRelativeRetrySucceededAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncRelativeRetrySucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncRelativeRetrySucceeded(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncRelativeRetrySucceededAsync(); + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202Retry200(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202Retry200Async(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202Retry200WithServiceResponseAsync(); + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202Retry200(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202Retry200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202Retry200Async(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202Retry200WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202Retry200(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202Retry200Async(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202Retry200WithServiceResponseAsync(); + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202Retry200(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202Retry200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202Retry200Async(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202Retry200WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetrySucceeded(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetrySucceededAsync(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetrySucceededWithServiceResponseAsync(); + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetrySucceeded(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetrySucceededAsync(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetrySucceeded(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetrySucceededAsync(); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(); + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetrySucceeded(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetrySucceededAsync(Product product); + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(Product product); + +} diff --git a/test/azure/src/main/java/fixtures/lro/LROSADs.java b/test/azure/src/main/java/fixtures/lro/LROSADs.java new file mode 100644 index 0000000000..072cbaa7fd --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/LROSADs.java @@ -0,0 +1,3187 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro; + +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.lro.models.LROSADsDelete202NonRetry400Headers; +import fixtures.lro.models.LROSADsDelete202RetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsDeleteAsyncRelativeRetry400Headers; +import fixtures.lro.models.LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders; +import fixtures.lro.models.LROSADsDeleteAsyncRelativeRetryNoStatusHeaders; +import fixtures.lro.models.LROSADsDeleteNonRetry400Headers; +import fixtures.lro.models.LROSADsPost202NoLocationHeaders; +import fixtures.lro.models.LROSADsPost202NonRetry400Headers; +import fixtures.lro.models.LROSADsPost202RetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsPostAsyncRelativeRetry400Headers; +import fixtures.lro.models.LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders; +import fixtures.lro.models.LROSADsPostAsyncRelativeRetryNoPayloadHeaders; +import fixtures.lro.models.LROSADsPostNonRetry400Headers; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetry400Headers; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetryNoStatusHeaders; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders; +import fixtures.lro.models.Product; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROSADs. + */ +public interface LROSADs { + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putNonRetry400(); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putNonRetry400Async(); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putNonRetry400WithServiceResponseAsync(); + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putNonRetry400(Product product); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putNonRetry400Async(Product product); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putNonRetry400WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutNonRetry400(); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutNonRetry400Async(); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutNonRetry400WithServiceResponseAsync(); + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutNonRetry400(Product product); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNonRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutNonRetry400Async(Product product); + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutNonRetry400WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putNonRetry201Creating400(); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonRetry201Creating400Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putNonRetry201Creating400Async(); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putNonRetry201Creating400WithServiceResponseAsync(); + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putNonRetry201Creating400(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonRetry201Creating400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putNonRetry201Creating400Async(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putNonRetry201Creating400WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutNonRetry201Creating400(); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNonRetry201Creating400Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutNonRetry201Creating400Async(); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutNonRetry201Creating400WithServiceResponseAsync(); + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutNonRetry201Creating400(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNonRetry201Creating400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutNonRetry201Creating400Async(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutNonRetry201Creating400WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putNonRetry201Creating400InvalidJson(); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putNonRetry201Creating400InvalidJsonAsync(); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(); + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putNonRetry201Creating400InvalidJson(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putNonRetry201Creating400InvalidJsonAsync(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutNonRetry201Creating400InvalidJson(); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutNonRetry201Creating400InvalidJsonAsync(); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(); + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutNonRetry201Creating400InvalidJson(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutNonRetry201Creating400InvalidJsonAsync(Product product); + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetry400(); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetry400Async(); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetry400WithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetry400(Product product); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetry400Async(Product product); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetry400WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetry400(); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetry400Async(); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetry400WithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetry400(Product product); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetry400Async(Product product); + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetry400WithServiceResponseAsync(Product product); + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteNonRetry400(); + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteNonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteNonRetry400Async(); + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteNonRetry400WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteNonRetry400(); + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteNonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteNonRetry400Async(); + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteNonRetry400WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete202NonRetry400(); + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete202NonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable delete202NonRetry400Async(); + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> delete202NonRetry400WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDelete202NonRetry400(); + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDelete202NonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDelete202NonRetry400Async(); + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDelete202NonRetry400WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncRelativeRetry400(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncRelativeRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncRelativeRetry400Async(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncRelativeRetry400WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncRelativeRetry400(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncRelativeRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncRelativeRetry400Async(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncRelativeRetry400WithServiceResponseAsync(); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postNonRetry400(); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postNonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postNonRetry400Async(); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postNonRetry400WithServiceResponseAsync(); + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postNonRetry400(Product product); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postNonRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postNonRetry400Async(Product product); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postNonRetry400WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostNonRetry400(); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostNonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostNonRetry400Async(); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostNonRetry400WithServiceResponseAsync(); + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostNonRetry400(Product product); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostNonRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostNonRetry400Async(Product product); + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostNonRetry400WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202NonRetry400(); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202NonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202NonRetry400Async(); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202NonRetry400WithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202NonRetry400(Product product); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202NonRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202NonRetry400Async(Product product); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202NonRetry400WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202NonRetry400(); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202NonRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202NonRetry400Async(); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202NonRetry400WithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202NonRetry400(Product product); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202NonRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202NonRetry400Async(Product product); + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202NonRetry400WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetry400(); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetry400Async(); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetry400WithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetry400(Product product); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetry400Async(Product product); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetry400WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetry400(); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetry400Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetry400Async(); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetry400WithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetry400(Product product); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetry400Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetry400Async(Product product); + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetry400WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putError201NoProvisioningStatePayload(); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putError201NoProvisioningStatePayloadAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putError201NoProvisioningStatePayloadAsync(); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putError201NoProvisioningStatePayloadWithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putError201NoProvisioningStatePayload(Product product); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putError201NoProvisioningStatePayloadAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putError201NoProvisioningStatePayloadAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putError201NoProvisioningStatePayloadWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutError201NoProvisioningStatePayload(); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutError201NoProvisioningStatePayloadAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutError201NoProvisioningStatePayloadAsync(); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutError201NoProvisioningStatePayload(Product product); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutError201NoProvisioningStatePayloadAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutError201NoProvisioningStatePayloadAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetryNoStatus(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetryNoStatusAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetryNoStatusWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetryNoStatus(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetryNoStatusAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetryNoStatusAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetryNoStatusWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetryNoStatus(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetryNoStatusAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetryNoStatus(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetryNoStatusAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetryNoStatusAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetryNoStatusPayload(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetryNoStatusPayloadAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetryNoStatusPayloadAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetryNoStatusPayload(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetryNoStatusPayloadAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetryNoStatusPayloadAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetryNoStatusPayload(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetryNoStatusPayloadAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetryNoStatusPayloadAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetryNoStatusPayload(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetryNoStatusPayloadAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetryNoStatusPayloadAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(Product product); + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete204Succeeded(); + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete204SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete204SucceededAsync(); + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete204SucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDelete204Succeeded(); + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDelete204SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable beginDelete204SucceededAsync(); + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> beginDelete204SucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncRelativeRetryNoStatus(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncRelativeRetryNoStatusAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncRelativeRetryNoStatus(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncRelativeRetryNoStatusAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202NoLocation(); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202NoLocationAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202NoLocationAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202NoLocationWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202NoLocation(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202NoLocationAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202NoLocationAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202NoLocationWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202NoLocation(); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202NoLocationAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202NoLocationAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202NoLocationWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202NoLocation(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202NoLocationAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202NoLocationAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202NoLocationWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetryNoPayload(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetryNoPayloadAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetryNoPayloadAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetryNoPayload(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetryNoPayloadAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetryNoPayloadAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetryNoPayload(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetryNoPayloadAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetryNoPayloadAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetryNoPayload(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetryNoPayloadAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetryNoPayloadAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200InvalidJson(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200InvalidJsonAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200InvalidJsonAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200InvalidJsonWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200InvalidJson(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200InvalidJsonAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200InvalidJsonAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200InvalidJsonWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200InvalidJson(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200InvalidJsonAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200InvalidJsonAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200InvalidJsonWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200InvalidJson(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200InvalidJsonAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200InvalidJsonAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200InvalidJsonWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetryInvalidHeader(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetryInvalidHeaderAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetryInvalidHeader(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetryInvalidHeaderAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetryInvalidHeader(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetryInvalidHeaderAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetryInvalidHeader(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetryInvalidHeaderAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetryInvalidJsonPolling(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetryInvalidJsonPollingAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRelativeRetryInvalidJsonPolling(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRelativeRetryInvalidJsonPollingAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRelativeRetryInvalidJsonPollingAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetryInvalidJsonPolling(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetryInvalidJsonPollingAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRelativeRetryInvalidJsonPolling(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRelativeRetryInvalidJsonPollingAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRelativeRetryInvalidJsonPollingAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(Product product); + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete202RetryInvalidHeader(); + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable delete202RetryInvalidHeaderAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> delete202RetryInvalidHeaderWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDelete202RetryInvalidHeader(); + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDelete202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDelete202RetryInvalidHeaderAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDelete202RetryInvalidHeaderWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncRelativeRetryInvalidHeader(); + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncRelativeRetryInvalidHeaderAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncRelativeRetryInvalidHeader(); + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncRelativeRetryInvalidHeaderAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncRelativeRetryInvalidJsonPolling(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncRelativeRetryInvalidJsonPollingAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncRelativeRetryInvalidJsonPolling(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncRelativeRetryInvalidJsonPollingAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202RetryInvalidHeader(); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202RetryInvalidHeaderAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202RetryInvalidHeaderWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202RetryInvalidHeader(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202RetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202RetryInvalidHeaderAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202RetryInvalidHeaderWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202RetryInvalidHeader(); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202RetryInvalidHeaderAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202RetryInvalidHeaderWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202RetryInvalidHeader(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202RetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202RetryInvalidHeaderAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202RetryInvalidHeaderWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetryInvalidHeader(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetryInvalidHeaderAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetryInvalidHeader(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetryInvalidHeaderAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetryInvalidHeader(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetryInvalidHeaderAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetryInvalidHeader(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetryInvalidHeaderAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetryInvalidJsonPolling(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetryInvalidJsonPollingAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRelativeRetryInvalidJsonPolling(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRelativeRetryInvalidJsonPollingAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRelativeRetryInvalidJsonPollingAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetryInvalidJsonPolling(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetryInvalidJsonPollingAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRelativeRetryInvalidJsonPolling(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRelativeRetryInvalidJsonPollingAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRelativeRetryInvalidJsonPollingAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(Product product); + +} diff --git a/test/azure/src/main/java/fixtures/lro/LROs.java b/test/azure/src/main/java/fixtures/lro/LROs.java new file mode 100644 index 0000000000..e5ba084a2c --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/LROs.java @@ -0,0 +1,4294 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro; + +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.lro.models.LROsDelete202NoRetry204Headers; +import fixtures.lro.models.LROsDelete202Retry200Headers; +import fixtures.lro.models.LROsDeleteAsyncNoHeaderInRetryHeaders; +import fixtures.lro.models.LROsDeleteAsyncNoRetrySucceededHeaders; +import fixtures.lro.models.LROsDeleteAsyncRetrycanceledHeaders; +import fixtures.lro.models.LROsDeleteAsyncRetryFailedHeaders; +import fixtures.lro.models.LROsDeleteAsyncRetrySucceededHeaders; +import fixtures.lro.models.LROsDeleteNoHeaderInRetryHeaders; +import fixtures.lro.models.LROsDeleteProvisioning202Accepted200SucceededHeaders; +import fixtures.lro.models.LROsDeleteProvisioning202Deletingcanceled200Headers; +import fixtures.lro.models.LROsDeleteProvisioning202DeletingFailed200Headers; +import fixtures.lro.models.LROsPost202NoRetry204Headers; +import fixtures.lro.models.LROsPost202Retry200Headers; +import fixtures.lro.models.LROsPostAsyncNoRetrySucceededHeaders; +import fixtures.lro.models.LROsPostAsyncRetrycanceledHeaders; +import fixtures.lro.models.LROsPostAsyncRetryFailedHeaders; +import fixtures.lro.models.LROsPostAsyncRetrySucceededHeaders; +import fixtures.lro.models.LROsPutAsyncNoHeaderInRetryHeaders; +import fixtures.lro.models.LROsPutAsyncNoRetrycanceledHeaders; +import fixtures.lro.models.LROsPutAsyncNoRetrySucceededHeaders; +import fixtures.lro.models.LROsPutAsyncRetryFailedHeaders; +import fixtures.lro.models.LROsPutAsyncRetrySucceededHeaders; +import fixtures.lro.models.LROsPutNoHeaderInRetryHeaders; +import fixtures.lro.models.Product; +import fixtures.lro.models.Sku; +import fixtures.lro.models.SubProduct; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROs. + */ +public interface LROs { + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200Succeeded(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200SucceededAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200SucceededWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200Succeeded(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200SucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200SucceededAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200SucceededWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200Succeeded(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200SucceededAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200SucceededWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200Succeeded(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200SucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200SucceededAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200SucceededWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200SucceededNoState(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200SucceededNoStateAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200SucceededNoStateAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200SucceededNoStateWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200SucceededNoState(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200SucceededNoStateAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200SucceededNoStateAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200SucceededNoStateWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200SucceededNoState(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200SucceededNoStateAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200SucceededNoStateAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200SucceededNoStateWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200SucceededNoState(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200SucceededNoStateAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200SucceededNoStateAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200SucceededNoStateWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put202Retry200(); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put202Retry200Async(); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put202Retry200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put202Retry200(Product product); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put202Retry200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put202Retry200Async(Product product); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put202Retry200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut202Retry200(); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut202Retry200Async(); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut202Retry200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut202Retry200(Product product); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut202Retry200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut202Retry200Async(Product product); + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut202Retry200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put201CreatingSucceeded200(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put201CreatingSucceeded200Async(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put201CreatingSucceeded200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put201CreatingSucceeded200(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put201CreatingSucceeded200Async(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put201CreatingSucceeded200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut201CreatingSucceeded200(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut201CreatingSucceeded200Async(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut201CreatingSucceeded200(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut201CreatingSucceeded200Async(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200UpdatingSucceeded204(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200UpdatingSucceeded204Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200UpdatingSucceeded204Async(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200UpdatingSucceeded204WithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200UpdatingSucceeded204(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200UpdatingSucceeded204Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200UpdatingSucceeded204Async(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200UpdatingSucceeded204WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200UpdatingSucceeded204(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200UpdatingSucceeded204Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200UpdatingSucceeded204Async(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200UpdatingSucceeded204WithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200UpdatingSucceeded204(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200UpdatingSucceeded204Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200UpdatingSucceeded204Async(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200UpdatingSucceeded204WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put201CreatingFailed200(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201CreatingFailed200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put201CreatingFailed200Async(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put201CreatingFailed200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put201CreatingFailed200(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201CreatingFailed200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put201CreatingFailed200Async(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put201CreatingFailed200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut201CreatingFailed200(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut201CreatingFailed200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut201CreatingFailed200Async(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut201CreatingFailed200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut201CreatingFailed200(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut201CreatingFailed200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut201CreatingFailed200Async(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut201CreatingFailed200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200Acceptedcanceled200(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200Acceptedcanceled200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200Acceptedcanceled200Async(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200Acceptedcanceled200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put200Acceptedcanceled200(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200Acceptedcanceled200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put200Acceptedcanceled200Async(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put200Acceptedcanceled200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200Acceptedcanceled200(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200Acceptedcanceled200Async(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200Acceptedcanceled200Async(); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200Acceptedcanceled200WithServiceResponseAsync(); + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut200Acceptedcanceled200(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut200Acceptedcanceled200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut200Acceptedcanceled200Async(Product product); + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut200Acceptedcanceled200WithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putNoHeaderInRetry(); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNoHeaderInRetryAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putNoHeaderInRetryAsync(); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putNoHeaderInRetryWithServiceResponseAsync(); + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putNoHeaderInRetry(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNoHeaderInRetryAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putNoHeaderInRetryAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putNoHeaderInRetryWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutNoHeaderInRetry(); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNoHeaderInRetryAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutNoHeaderInRetryAsync(); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutNoHeaderInRetryWithServiceResponseAsync(); + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutNoHeaderInRetry(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNoHeaderInRetryAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutNoHeaderInRetryAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutNoHeaderInRetryWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRetrySucceeded(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRetrySucceededAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRetrySucceededWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRetrySucceeded(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRetrySucceededAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRetrySucceeded(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRetrySucceededAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRetrySucceeded(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRetrySucceededAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncNoRetrySucceeded(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncNoRetrySucceededAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncNoRetrySucceededWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncNoRetrySucceeded(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncNoRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncNoRetrySucceededAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncNoRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncNoRetrySucceeded(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncNoRetrySucceededAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncNoRetrySucceededWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncNoRetrySucceeded(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncNoRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncNoRetrySucceededAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncNoRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRetryFailed(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRetryFailedAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRetryFailedAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRetryFailedWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRetryFailed(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRetryFailedAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRetryFailedAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRetryFailedWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRetryFailed(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRetryFailedAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRetryFailedAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRetryFailedWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRetryFailed(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRetryFailedAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRetryFailedAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRetryFailedWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncNoRetrycanceled(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncNoRetrycanceledAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncNoRetrycanceledAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncNoRetrycanceledWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncNoRetrycanceled(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncNoRetrycanceledAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncNoRetrycanceledAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncNoRetrycanceledWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncNoRetrycanceled(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncNoRetrycanceledAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncNoRetrycanceledAsync(); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncNoRetrycanceledWithServiceResponseAsync(); + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncNoRetrycanceled(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncNoRetrycanceledAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncNoRetrycanceledAsync(Product product); + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncNoRetrycanceledWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncNoHeaderInRetry(); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncNoHeaderInRetryAsync(); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncNoHeaderInRetryWithServiceResponseAsync(); + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncNoHeaderInRetry(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncNoHeaderInRetryAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncNoHeaderInRetryAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncNoHeaderInRetryWithServiceResponseAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncNoHeaderInRetry(); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncNoHeaderInRetryAsync(); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(); + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncNoHeaderInRetry(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncNoHeaderInRetryAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncNoHeaderInRetryAsync(Product product); + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(Product product); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku putNonResource(); + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonResourceAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable putNonResourceAsync(); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> putNonResourceWithServiceResponseAsync(); + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku putNonResource(Sku sku); + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonResourceAsync(Sku sku, final ServiceCallback serviceCallback); + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable putNonResourceAsync(Sku sku); + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> putNonResourceWithServiceResponseAsync(Sku sku); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku beginPutNonResource(); + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNonResourceAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable beginPutNonResourceAsync(); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> beginPutNonResourceWithServiceResponseAsync(); + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku beginPutNonResource(Sku sku); + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutNonResourceAsync(Sku sku, final ServiceCallback serviceCallback); + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable beginPutNonResourceAsync(Sku sku); + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> beginPutNonResourceWithServiceResponseAsync(Sku sku); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku putAsyncNonResource(); + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncNonResourceAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable putAsyncNonResourceAsync(); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> putAsyncNonResourceWithServiceResponseAsync(); + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku putAsyncNonResource(Sku sku); + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncNonResourceAsync(Sku sku, final ServiceCallback serviceCallback); + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable putAsyncNonResourceAsync(Sku sku); + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> putAsyncNonResourceWithServiceResponseAsync(Sku sku); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku beginPutAsyncNonResource(); + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncNonResourceAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable beginPutAsyncNonResourceAsync(); + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> beginPutAsyncNonResourceWithServiceResponseAsync(); + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku beginPutAsyncNonResource(Sku sku); + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncNonResourceAsync(Sku sku, final ServiceCallback serviceCallback); + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable beginPutAsyncNonResourceAsync(Sku sku); + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> beginPutAsyncNonResourceWithServiceResponseAsync(Sku sku); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + SubProduct putSubResource(); + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putSubResourceAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable putSubResourceAsync(); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable> putSubResourceWithServiceResponseAsync(); + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + SubProduct putSubResource(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putSubResourceAsync(SubProduct product, final ServiceCallback serviceCallback); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable putSubResourceAsync(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable> putSubResourceWithServiceResponseAsync(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + SubProduct beginPutSubResource(); + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutSubResourceAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable beginPutSubResourceAsync(); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable> beginPutSubResourceWithServiceResponseAsync(); + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + SubProduct beginPutSubResource(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutSubResourceAsync(SubProduct product, final ServiceCallback serviceCallback); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable beginPutSubResourceAsync(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable> beginPutSubResourceWithServiceResponseAsync(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + SubProduct putAsyncSubResource(); + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncSubResourceAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable putAsyncSubResourceAsync(); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable> putAsyncSubResourceWithServiceResponseAsync(); + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + SubProduct putAsyncSubResource(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncSubResourceAsync(SubProduct product, final ServiceCallback serviceCallback); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable putAsyncSubResourceAsync(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable> putAsyncSubResourceWithServiceResponseAsync(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + SubProduct beginPutAsyncSubResource(); + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncSubResourceAsync(final ServiceCallback serviceCallback); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable beginPutAsyncSubResourceAsync(); + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable> beginPutAsyncSubResourceWithServiceResponseAsync(); + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + SubProduct beginPutAsyncSubResource(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncSubResourceAsync(SubProduct product, final ServiceCallback serviceCallback); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable beginPutAsyncSubResourceAsync(SubProduct product); + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + Observable> beginPutAsyncSubResourceWithServiceResponseAsync(SubProduct product); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product deleteProvisioning202Accepted200Succeeded(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable deleteProvisioning202Accepted200SucceededAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> deleteProvisioning202Accepted200SucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginDeleteProvisioning202Accepted200Succeeded(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginDeleteProvisioning202Accepted200SucceededAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product deleteProvisioning202DeletingFailed200(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteProvisioning202DeletingFailed200Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable deleteProvisioning202DeletingFailed200Async(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> deleteProvisioning202DeletingFailed200WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginDeleteProvisioning202DeletingFailed200(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteProvisioning202DeletingFailed200Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginDeleteProvisioning202DeletingFailed200Async(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product deleteProvisioning202Deletingcanceled200(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteProvisioning202Deletingcanceled200Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable deleteProvisioning202Deletingcanceled200Async(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> deleteProvisioning202Deletingcanceled200WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginDeleteProvisioning202Deletingcanceled200(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteProvisioning202Deletingcanceled200Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginDeleteProvisioning202Deletingcanceled200Async(); + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync(); + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete204Succeeded(); + + /** + * Long running delete succeeds and returns right away. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete204SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete204SucceededAsync(); + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete204SucceededWithServiceResponseAsync(); + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDelete204Succeeded(); + + /** + * Long running delete succeeds and returns right away. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDelete204SucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable beginDelete204SucceededAsync(); + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> beginDelete204SucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product delete202Retry200(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable delete202Retry200Async(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> delete202Retry200WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginDelete202Retry200(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDelete202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginDelete202Retry200Async(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginDelete202Retry200WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product delete202NoRetry204(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete202NoRetry204Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable delete202NoRetry204Async(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> delete202NoRetry204WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginDelete202NoRetry204(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDelete202NoRetry204Async(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginDelete202NoRetry204Async(); + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginDelete202NoRetry204WithServiceResponseAsync(); + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteNoHeaderInRetry(); + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteNoHeaderInRetryAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteNoHeaderInRetryAsync(); + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteNoHeaderInRetryWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteNoHeaderInRetry(); + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteNoHeaderInRetryAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteNoHeaderInRetryAsync(); + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteNoHeaderInRetryWithServiceResponseAsync(); + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncNoHeaderInRetry(); + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncNoHeaderInRetryAsync(); + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncNoHeaderInRetryWithServiceResponseAsync(); + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncNoHeaderInRetry(); + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncNoHeaderInRetryAsync(); + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncRetrySucceeded(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncRetrySucceededAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncRetrySucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncRetrySucceeded(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncRetrySucceededAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncRetrySucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncNoRetrySucceeded(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncNoRetrySucceededAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncNoRetrySucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncNoRetrySucceeded(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncNoRetrySucceededAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncRetryFailed(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncRetryFailedAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncRetryFailedAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncRetryFailedWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncRetryFailed(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncRetryFailedAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncRetryFailedAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncRetryFailedWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void deleteAsyncRetrycanceled(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture deleteAsyncRetrycanceledAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable deleteAsyncRetrycanceledAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> deleteAsyncRetrycanceledWithServiceResponseAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginDeleteAsyncRetrycanceled(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginDeleteAsyncRetrycanceledAsync(final ServiceCallback serviceCallback); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginDeleteAsyncRetrycanceledAsync(); + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginDeleteAsyncRetrycanceledWithServiceResponseAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku post200WithPayload(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post200WithPayloadAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable post200WithPayloadAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> post200WithPayloadWithServiceResponseAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + Sku beginPost200WithPayload(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost200WithPayloadAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable beginPost200WithPayloadAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + Observable> beginPost200WithPayloadWithServiceResponseAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202Retry200(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202Retry200Async(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202Retry200WithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202Retry200(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202Retry200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202Retry200Async(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202Retry200WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202Retry200(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202Retry200Async(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202Retry200WithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202Retry200(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202Retry200Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202Retry200Async(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202Retry200WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product post202NoRetry204(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202NoRetry204Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable post202NoRetry204Async(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> post202NoRetry204WithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product post202NoRetry204(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202NoRetry204Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable post202NoRetry204Async(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> post202NoRetry204WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPost202NoRetry204(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202NoRetry204Async(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPost202NoRetry204Async(); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPost202NoRetry204WithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPost202NoRetry204(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202NoRetry204Async(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPost202NoRetry204Async(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPost202NoRetry204WithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product postAsyncRetrySucceeded(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable postAsyncRetrySucceededAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> postAsyncRetrySucceededWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product postAsyncRetrySucceeded(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable postAsyncRetrySucceededAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> postAsyncRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPostAsyncRetrySucceeded(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPostAsyncRetrySucceededAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPostAsyncRetrySucceeded(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPostAsyncRetrySucceededAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product postAsyncNoRetrySucceeded(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable postAsyncNoRetrySucceededAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> postAsyncNoRetrySucceededWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product postAsyncNoRetrySucceeded(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncNoRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable postAsyncNoRetrySucceededAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> postAsyncNoRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPostAsyncNoRetrySucceeded(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPostAsyncNoRetrySucceededAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPostAsyncNoRetrySucceededWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPostAsyncNoRetrySucceeded(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncNoRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPostAsyncNoRetrySucceededAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPostAsyncNoRetrySucceededWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRetryFailed(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRetryFailedAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRetryFailedAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRetryFailedWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRetryFailed(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRetryFailedAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRetryFailedAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRetryFailedWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRetryFailed(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRetryFailedAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRetryFailedAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRetryFailedWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRetryFailed(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRetryFailedAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRetryFailedAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRetryFailedWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRetrycanceled(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRetrycanceledAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRetrycanceledAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRetrycanceledWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRetrycanceled(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRetrycanceledAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRetrycanceledAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRetrycanceledWithServiceResponseAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRetrycanceled(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRetrycanceledAsync(final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRetrycanceledAsync(); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRetrycanceledWithServiceResponseAsync(); + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRetrycanceled(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRetrycanceledAsync(Product product, final ServiceCallback serviceCallback); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRetrycanceledAsync(Product product); + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRetrycanceledWithServiceResponseAsync(Product product); + +} diff --git a/test/azure/src/main/java/fixtures/lro/LROsCustomHeaders.java b/test/azure/src/main/java/fixtures/lro/LROsCustomHeaders.java new file mode 100644 index 0000000000..b90b7c0006 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/LROsCustomHeaders.java @@ -0,0 +1,606 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro; + +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.lro.models.LROsCustomHeaderPost202Retry200Headers; +import fixtures.lro.models.LROsCustomHeaderPostAsyncRetrySucceededHeaders; +import fixtures.lro.models.LROsCustomHeaderPutAsyncRetrySucceededHeaders; +import fixtures.lro.models.Product; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROsCustomHeaders. + */ +public interface LROsCustomHeaders { + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRetrySucceeded(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRetrySucceededAsync(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRetrySucceededWithServiceResponseAsync(); + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product putAsyncRetrySucceeded(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable putAsyncRetrySucceededAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> putAsyncRetrySucceededWithServiceResponseAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRetrySucceeded(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRetrySucceededAsync(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync(); + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPutAsyncRetrySucceeded(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPutAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPutAsyncRetrySucceededAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put201CreatingSucceeded200(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put201CreatingSucceeded200Async(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put201CreatingSucceeded200WithServiceResponseAsync(); + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product put201CreatingSucceeded200(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable put201CreatingSucceeded200Async(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> put201CreatingSucceeded200WithServiceResponseAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut201CreatingSucceeded200(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut201CreatingSucceeded200Async(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(); + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product beginPut201CreatingSucceeded200(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPut201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable beginPut201CreatingSucceeded200Async(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202Retry200(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202Retry200Async(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202Retry200WithServiceResponseAsync(); + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202Retry200(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202Retry200Async(Product product, final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post202Retry200Async(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post202Retry200WithServiceResponseAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202Retry200(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202Retry200Async(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202Retry200WithServiceResponseAsync(); + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPost202Retry200(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPost202Retry200Async(Product product, final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPost202Retry200Async(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPost202Retry200WithServiceResponseAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRetrySucceeded(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRetrySucceededAsync(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRetrySucceededWithServiceResponseAsync(); + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postAsyncRetrySucceeded(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable postAsyncRetrySucceededAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> postAsyncRetrySucceededWithServiceResponseAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRetrySucceeded(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRetrySucceededAsync(final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRetrySucceededAsync(); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync(); + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void beginPostAsyncRetrySucceeded(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture beginPostAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable beginPostAsyncRetrySucceededAsync(Product product); + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync(Product product); + +} diff --git a/test/azure/src/main/java/fixtures/lro/implementation/AutoRestLongRunningOperationTestServiceImpl.java b/test/azure/src/main/java/fixtures/lro/implementation/AutoRestLongRunningOperationTestServiceImpl.java new file mode 100644 index 0000000000..eff8867d30 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/implementation/AutoRestLongRunningOperationTestServiceImpl.java @@ -0,0 +1,209 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import fixtures.lro.AutoRestLongRunningOperationTestService; +import fixtures.lro.LRORetrys; +import fixtures.lro.LROs; +import fixtures.lro.LROSADs; +import fixtures.lro.LROsCustomHeaders; + +/** + * Initializes a new instance of the AutoRestLongRunningOperationTestServiceImpl class. + */ +public class AutoRestLongRunningOperationTestServiceImpl extends AzureServiceClient implements AutoRestLongRunningOperationTestService { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestLongRunningOperationTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestLongRunningOperationTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestLongRunningOperationTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The LROs object to access its operations. + */ + private LROs lROs; + + /** + * Gets the LROs object to access its operations. + * @return the LROs object. + */ + public LROs lROs() { + return this.lROs; + } + + /** + * The LRORetrys object to access its operations. + */ + private LRORetrys lRORetrys; + + /** + * Gets the LRORetrys object to access its operations. + * @return the LRORetrys object. + */ + public LRORetrys lRORetrys() { + return this.lRORetrys; + } + + /** + * The LROSADs object to access its operations. + */ + private LROSADs lROSADs; + + /** + * Gets the LROSADs object to access its operations. + * @return the LROSADs object. + */ + public LROSADs lROSADs() { + return this.lROSADs; + } + + /** + * The LROsCustomHeaders object to access its operations. + */ + private LROsCustomHeaders lROsCustomHeaders; + + /** + * Gets the LROsCustomHeaders object to access its operations. + * @return the LROsCustomHeaders object. + */ + public LROsCustomHeaders lROsCustomHeaders() { + return this.lROsCustomHeaders; + } + + /** + * Initializes an instance of AutoRestLongRunningOperationTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestLongRunningOperationTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestLongRunningOperationTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestLongRunningOperationTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestLongRunningOperationTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestLongRunningOperationTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.lROs = new LROsImpl(restClient().retrofit(), this); + this.lRORetrys = new LRORetrysImpl(restClient().retrofit(), this); + this.lROSADs = new LROSADsImpl(restClient().retrofit(), this); + this.lROsCustomHeaders = new LROsCustomHeadersImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestLongRunningOperationTestService", "1.0.0"); + } +} diff --git a/test/azure/src/main/java/fixtures/lro/implementation/LRORetrysImpl.java b/test/azure/src/main/java/fixtures/lro/implementation/LRORetrysImpl.java new file mode 100644 index 0000000000..c250cca625 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/implementation/LRORetrysImpl.java @@ -0,0 +1,1396 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import retrofit2.Retrofit; +import fixtures.lro.LRORetrys; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import fixtures.lro.models.LRORetrysDelete202Retry200Headers; +import fixtures.lro.models.LRORetrysDeleteAsyncRelativeRetrySucceededHeaders; +import fixtures.lro.models.LRORetrysDeleteProvisioning202Accepted200SucceededHeaders; +import fixtures.lro.models.LRORetrysPost202Retry200Headers; +import fixtures.lro.models.LRORetrysPostAsyncRelativeRetrySucceededHeaders; +import fixtures.lro.models.LRORetrysPutAsyncRelativeRetrySucceededHeaders; +import fixtures.lro.models.Product; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LRORetrys. + */ +public class LRORetrysImpl implements LRORetrys { + /** The Retrofit service to perform REST calls. */ + private LRORetrysService service; + /** The service client containing this operation class. */ + private AutoRestLongRunningOperationTestServiceImpl client; + + /** + * Initializes an instance of LRORetrysImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LRORetrysImpl(Retrofit retrofit, AutoRestLongRunningOperationTestServiceImpl client) { + this.service = retrofit.create(LRORetrysService.class); + this.client = client; + } + + /** + * The interface defining all the services for LRORetrys to be + * used by Retrofit to perform actually REST calls. + */ + interface LRORetrysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys put201CreatingSucceeded200" }) + @PUT("lro/retryerror/put/201/creating/succeeded/200") + Observable> put201CreatingSucceeded200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginPut201CreatingSucceeded200" }) + @PUT("lro/retryerror/put/201/creating/succeeded/200") + Observable> beginPut201CreatingSucceeded200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys putAsyncRelativeRetrySucceeded" }) + @PUT("lro/retryerror/putasync/retry/succeeded") + Observable> putAsyncRelativeRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginPutAsyncRelativeRetrySucceeded" }) + @PUT("lro/retryerror/putasync/retry/succeeded") + Observable> beginPutAsyncRelativeRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys deleteProvisioning202Accepted200Succeeded" }) + @HTTP(path = "lro/retryerror/delete/provisioning/202/accepted/200/succeeded", method = "DELETE", hasBody = true) + Observable> deleteProvisioning202Accepted200Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginDeleteProvisioning202Accepted200Succeeded" }) + @HTTP(path = "lro/retryerror/delete/provisioning/202/accepted/200/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteProvisioning202Accepted200Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys delete202Retry200" }) + @HTTP(path = "lro/retryerror/delete/202/retry/200", method = "DELETE", hasBody = true) + Observable> delete202Retry200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginDelete202Retry200" }) + @HTTP(path = "lro/retryerror/delete/202/retry/200", method = "DELETE", hasBody = true) + Observable> beginDelete202Retry200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys deleteAsyncRelativeRetrySucceeded" }) + @HTTP(path = "lro/retryerror/deleteasync/retry/succeeded", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginDeleteAsyncRelativeRetrySucceeded" }) + @HTTP(path = "lro/retryerror/deleteasync/retry/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys post202Retry200" }) + @POST("lro/retryerror/post/202/retry/200") + Observable> post202Retry200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginPost202Retry200" }) + @POST("lro/retryerror/post/202/retry/200") + Observable> beginPost202Retry200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys postAsyncRelativeRetrySucceeded" }) + @POST("lro/retryerror/postasync/retry/succeeded") + Observable> postAsyncRelativeRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginPostAsyncRelativeRetrySucceeded" }) + @POST("lro/retryerror/postasync/retry/succeeded") + Observable> beginPostAsyncRelativeRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put201CreatingSucceeded200() { + return put201CreatingSucceeded200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async() { + return put201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put201CreatingSucceeded200(Product product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async(Product product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut201CreatingSucceeded200() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut201CreatingSucceeded200Async() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync() { + final Product product = null; + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut201CreatingSucceeded200(Product product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut201CreatingSucceeded200Async(Product product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut201CreatingSucceeded200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetrySucceeded() { + return putAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetrySucceededAsync() { + return putAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetrySucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPutAsyncRelativeRetrySucceededHeaders.class); + } + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetrySucceeded(Product product) { + return putAsyncRelativeRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetrySucceededAsync(Product product) { + return putAsyncRelativeRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPutAsyncRelativeRetrySucceededHeaders.class); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetrySucceeded() { + return beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetrySucceededAsync() { + return beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetrySucceeded(Product product) { + return beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetrySucceededAsync(Product product) { + return beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysPutAsyncRelativeRetrySucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product deleteProvisioning202Accepted200Succeeded() { + return deleteProvisioning202Accepted200SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteProvisioning202Accepted200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteProvisioning202Accepted200SucceededAsync() { + return deleteProvisioning202Accepted200SucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteProvisioning202Accepted200SucceededWithServiceResponseAsync() { + Observable> observable = service.deleteProvisioning202Accepted200Succeeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginDeleteProvisioning202Accepted200Succeeded() { + return beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginDeleteProvisioning202Accepted200SucceededAsync() { + return beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync() { + return service.beginDeleteProvisioning202Accepted200Succeeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteProvisioning202Accepted200SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteProvisioning202Accepted200SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete202Retry200() { + delete202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202Retry200Async() { + return delete202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202Retry200WithServiceResponseAsync() { + Observable> observable = service.delete202Retry200(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysDelete202Retry200Headers.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete202Retry200() { + beginDelete202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDelete202Retry200Async() { + return beginDelete202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDelete202Retry200WithServiceResponseAsync() { + return service.beginDelete202Retry200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysDelete202Retry200Headers.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetrySucceeded() { + deleteAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetrySucceededAsync() { + return deleteAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetrySucceededWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetrySucceeded() { + beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetrySucceededAsync() { + return beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.class); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200() { + post202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async() { + return post202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPost202Retry200Headers.class); + } + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200(Product product) { + post202Retry200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async(Product product) { + return post202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPost202Retry200Headers.class); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200() { + beginPost202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async() { + return beginPost202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync() { + final Product product = null; + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200(Product product) { + beginPost202Retry200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async(Product product) { + return beginPost202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysPost202Retry200Headers.class); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetrySucceeded() { + postAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetrySucceededAsync() { + return postAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetrySucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPostAsyncRelativeRetrySucceededHeaders.class); + } + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetrySucceeded(Product product) { + postAsyncRelativeRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetrySucceededAsync(Product product) { + return postAsyncRelativeRetrySucceededWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPostAsyncRelativeRetrySucceededHeaders.class); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetrySucceeded() { + beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetrySucceededAsync() { + return beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetrySucceeded(Product product) { + beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetrySucceededAsync(Product product) { + return beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysPostAsyncRelativeRetrySucceededHeaders.class); + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/implementation/LROSADsImpl.java b/test/azure/src/main/java/fixtures/lro/implementation/LROSADsImpl.java new file mode 100644 index 0000000000..da0e239c1f --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/implementation/LROSADsImpl.java @@ -0,0 +1,5380 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import retrofit2.Retrofit; +import fixtures.lro.LROSADs; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import fixtures.lro.models.LROSADsDelete202NonRetry400Headers; +import fixtures.lro.models.LROSADsDelete202RetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsDeleteAsyncRelativeRetry400Headers; +import fixtures.lro.models.LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders; +import fixtures.lro.models.LROSADsDeleteAsyncRelativeRetryNoStatusHeaders; +import fixtures.lro.models.LROSADsDeleteNonRetry400Headers; +import fixtures.lro.models.LROSADsPost202NoLocationHeaders; +import fixtures.lro.models.LROSADsPost202NonRetry400Headers; +import fixtures.lro.models.LROSADsPost202RetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsPostAsyncRelativeRetry400Headers; +import fixtures.lro.models.LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders; +import fixtures.lro.models.LROSADsPostAsyncRelativeRetryNoPayloadHeaders; +import fixtures.lro.models.LROSADsPostNonRetry400Headers; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetry400Headers; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetryNoStatusHeaders; +import fixtures.lro.models.LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders; +import fixtures.lro.models.Product; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROSADs. + */ +public class LROSADsImpl implements LROSADs { + /** The Retrofit service to perform REST calls. */ + private LROSADsService service; + /** The service client containing this operation class. */ + private AutoRestLongRunningOperationTestServiceImpl client; + + /** + * Initializes an instance of LROSADsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LROSADsImpl(Retrofit retrofit, AutoRestLongRunningOperationTestServiceImpl client) { + this.service = retrofit.create(LROSADsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LROSADs to be + * used by Retrofit to perform actually REST calls. + */ + interface LROSADsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putNonRetry400" }) + @PUT("lro/nonretryerror/put/400") + Observable> putNonRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutNonRetry400" }) + @PUT("lro/nonretryerror/put/400") + Observable> beginPutNonRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putNonRetry201Creating400" }) + @PUT("lro/nonretryerror/put/201/creating/400") + Observable> putNonRetry201Creating400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutNonRetry201Creating400" }) + @PUT("lro/nonretryerror/put/201/creating/400") + Observable> beginPutNonRetry201Creating400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putNonRetry201Creating400InvalidJson" }) + @PUT("lro/nonretryerror/put/201/creating/400/invalidjson") + Observable> putNonRetry201Creating400InvalidJson(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutNonRetry201Creating400InvalidJson" }) + @PUT("lro/nonretryerror/put/201/creating/400/invalidjson") + Observable> beginPutNonRetry201Creating400InvalidJson(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetry400" }) + @PUT("lro/nonretryerror/putasync/retry/400") + Observable> putAsyncRelativeRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetry400" }) + @PUT("lro/nonretryerror/putasync/retry/400") + Observable> beginPutAsyncRelativeRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteNonRetry400" }) + @HTTP(path = "lro/nonretryerror/delete/400", method = "DELETE", hasBody = true) + Observable> deleteNonRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteNonRetry400" }) + @HTTP(path = "lro/nonretryerror/delete/400", method = "DELETE", hasBody = true) + Observable> beginDeleteNonRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs delete202NonRetry400" }) + @HTTP(path = "lro/nonretryerror/delete/202/retry/400", method = "DELETE", hasBody = true) + Observable> delete202NonRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDelete202NonRetry400" }) + @HTTP(path = "lro/nonretryerror/delete/202/retry/400", method = "DELETE", hasBody = true) + Observable> beginDelete202NonRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteAsyncRelativeRetry400" }) + @HTTP(path = "lro/nonretryerror/deleteasync/retry/400", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteAsyncRelativeRetry400" }) + @HTTP(path = "lro/nonretryerror/deleteasync/retry/400", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postNonRetry400" }) + @POST("lro/nonretryerror/post/400") + Observable> postNonRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostNonRetry400" }) + @POST("lro/nonretryerror/post/400") + Observable> beginPostNonRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs post202NonRetry400" }) + @POST("lro/nonretryerror/post/202/retry/400") + Observable> post202NonRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPost202NonRetry400" }) + @POST("lro/nonretryerror/post/202/retry/400") + Observable> beginPost202NonRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postAsyncRelativeRetry400" }) + @POST("lro/nonretryerror/postasync/retry/400") + Observable> postAsyncRelativeRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostAsyncRelativeRetry400" }) + @POST("lro/nonretryerror/postasync/retry/400") + Observable> beginPostAsyncRelativeRetry400(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putError201NoProvisioningStatePayload" }) + @PUT("lro/error/put/201/noprovisioningstatepayload") + Observable> putError201NoProvisioningStatePayload(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutError201NoProvisioningStatePayload" }) + @PUT("lro/error/put/201/noprovisioningstatepayload") + Observable> beginPutError201NoProvisioningStatePayload(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetryNoStatus" }) + @PUT("lro/error/putasync/retry/nostatus") + Observable> putAsyncRelativeRetryNoStatus(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetryNoStatus" }) + @PUT("lro/error/putasync/retry/nostatus") + Observable> beginPutAsyncRelativeRetryNoStatus(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetryNoStatusPayload" }) + @PUT("lro/error/putasync/retry/nostatuspayload") + Observable> putAsyncRelativeRetryNoStatusPayload(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetryNoStatusPayload" }) + @PUT("lro/error/putasync/retry/nostatuspayload") + Observable> beginPutAsyncRelativeRetryNoStatusPayload(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs delete204Succeeded" }) + @HTTP(path = "lro/error/delete/204/nolocation", method = "DELETE", hasBody = true) + Observable> delete204Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDelete204Succeeded" }) + @HTTP(path = "lro/error/delete/204/nolocation", method = "DELETE", hasBody = true) + Observable> beginDelete204Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteAsyncRelativeRetryNoStatus" }) + @HTTP(path = "lro/error/deleteasync/retry/nostatus", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetryNoStatus(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteAsyncRelativeRetryNoStatus" }) + @HTTP(path = "lro/error/deleteasync/retry/nostatus", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetryNoStatus(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs post202NoLocation" }) + @POST("lro/error/post/202/nolocation") + Observable> post202NoLocation(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPost202NoLocation" }) + @POST("lro/error/post/202/nolocation") + Observable> beginPost202NoLocation(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postAsyncRelativeRetryNoPayload" }) + @POST("lro/error/postasync/retry/nopayload") + Observable> postAsyncRelativeRetryNoPayload(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostAsyncRelativeRetryNoPayload" }) + @POST("lro/error/postasync/retry/nopayload") + Observable> beginPostAsyncRelativeRetryNoPayload(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs put200InvalidJson" }) + @PUT("lro/error/put/200/invalidjson") + Observable> put200InvalidJson(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPut200InvalidJson" }) + @PUT("lro/error/put/200/invalidjson") + Observable> beginPut200InvalidJson(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetryInvalidHeader" }) + @PUT("lro/error/putasync/retry/invalidheader") + Observable> putAsyncRelativeRetryInvalidHeader(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetryInvalidHeader" }) + @PUT("lro/error/putasync/retry/invalidheader") + Observable> beginPutAsyncRelativeRetryInvalidHeader(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetryInvalidJsonPolling" }) + @PUT("lro/error/putasync/retry/invalidjsonpolling") + Observable> putAsyncRelativeRetryInvalidJsonPolling(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetryInvalidJsonPolling" }) + @PUT("lro/error/putasync/retry/invalidjsonpolling") + Observable> beginPutAsyncRelativeRetryInvalidJsonPolling(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs delete202RetryInvalidHeader" }) + @HTTP(path = "lro/error/delete/202/retry/invalidheader", method = "DELETE", hasBody = true) + Observable> delete202RetryInvalidHeader(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDelete202RetryInvalidHeader" }) + @HTTP(path = "lro/error/delete/202/retry/invalidheader", method = "DELETE", hasBody = true) + Observable> beginDelete202RetryInvalidHeader(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteAsyncRelativeRetryInvalidHeader" }) + @HTTP(path = "lro/error/deleteasync/retry/invalidheader", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetryInvalidHeader(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteAsyncRelativeRetryInvalidHeader" }) + @HTTP(path = "lro/error/deleteasync/retry/invalidheader", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetryInvalidHeader(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteAsyncRelativeRetryInvalidJsonPolling" }) + @HTTP(path = "lro/error/deleteasync/retry/invalidjsonpolling", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetryInvalidJsonPolling(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteAsyncRelativeRetryInvalidJsonPolling" }) + @HTTP(path = "lro/error/deleteasync/retry/invalidjsonpolling", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetryInvalidJsonPolling(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs post202RetryInvalidHeader" }) + @POST("lro/error/post/202/retry/invalidheader") + Observable> post202RetryInvalidHeader(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPost202RetryInvalidHeader" }) + @POST("lro/error/post/202/retry/invalidheader") + Observable> beginPost202RetryInvalidHeader(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postAsyncRelativeRetryInvalidHeader" }) + @POST("lro/error/postasync/retry/invalidheader") + Observable> postAsyncRelativeRetryInvalidHeader(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostAsyncRelativeRetryInvalidHeader" }) + @POST("lro/error/postasync/retry/invalidheader") + Observable> beginPostAsyncRelativeRetryInvalidHeader(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postAsyncRelativeRetryInvalidJsonPolling" }) + @POST("lro/error/postasync/retry/invalidjsonpolling") + Observable> postAsyncRelativeRetryInvalidJsonPolling(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostAsyncRelativeRetryInvalidJsonPolling" }) + @POST("lro/error/postasync/retry/invalidjsonpolling") + Observable> beginPostAsyncRelativeRetryInvalidJsonPolling(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putNonRetry400() { + return putNonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry400Async() { + return putNonRetry400WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry400WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putNonRetry400(Product product) { + return putNonRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry400Async(Product product) { + return putNonRetry400WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutNonRetry400() { + return beginPutNonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutNonRetry400Async() { + return beginPutNonRetry400WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutNonRetry400WithServiceResponseAsync() { + final Product product = null; + return service.beginPutNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutNonRetry400(Product product) { + return beginPutNonRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutNonRetry400Async(Product product) { + return beginPutNonRetry400WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutNonRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutNonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putNonRetry201Creating400() { + return putNonRetry201Creating400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry201Creating400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry201Creating400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry201Creating400Async() { + return putNonRetry201Creating400WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry201Creating400WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putNonRetry201Creating400(Product product) { + return putNonRetry201Creating400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry201Creating400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry201Creating400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry201Creating400Async(Product product) { + return putNonRetry201Creating400WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry201Creating400WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutNonRetry201Creating400() { + return beginPutNonRetry201Creating400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry201Creating400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry201Creating400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutNonRetry201Creating400Async() { + return beginPutNonRetry201Creating400WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutNonRetry201Creating400WithServiceResponseAsync() { + final Product product = null; + return service.beginPutNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry201Creating400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutNonRetry201Creating400(Product product) { + return beginPutNonRetry201Creating400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry201Creating400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry201Creating400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutNonRetry201Creating400Async(Product product) { + return beginPutNonRetry201Creating400WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutNonRetry201Creating400WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry201Creating400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutNonRetry201Creating400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putNonRetry201Creating400InvalidJson() { + return putNonRetry201Creating400InvalidJsonWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry201Creating400InvalidJsonAsync() { + return putNonRetry201Creating400InvalidJsonWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry201Creating400InvalidJsonWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putNonRetry201Creating400InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putNonRetry201Creating400InvalidJson(Product product) { + return putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry201Creating400InvalidJsonAsync(Product product) { + return putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putNonRetry201Creating400InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutNonRetry201Creating400InvalidJson() { + return beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutNonRetry201Creating400InvalidJsonAsync() { + return beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync() { + final Product product = null; + return service.beginPutNonRetry201Creating400InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry201Creating400InvalidJsonDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutNonRetry201Creating400InvalidJson(Product product) { + return beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry201Creating400InvalidJsonAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutNonRetry201Creating400InvalidJsonAsync(Product product) { + return beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutNonRetry201Creating400InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry201Creating400InvalidJsonDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutNonRetry201Creating400InvalidJsonDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetry400() { + return putAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetry400Async() { + return putAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetry400WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetry400Headers.class); + } + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetry400(Product product) { + return putAsyncRelativeRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetry400Async(Product product) { + return putAsyncRelativeRetry400WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetry400Headers.class); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetry400() { + return beginPutAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetry400Async() { + return beginPutAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetry400WithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetry400(Product product) { + return beginPutAsyncRelativeRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetry400Async(Product product) { + return beginPutAsyncRelativeRetry400WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetry400Headers.class); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteNonRetry400() { + deleteNonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteNonRetry400Async() { + return deleteNonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteNonRetry400WithServiceResponseAsync() { + Observable> observable = service.deleteNonRetry400(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteNonRetry400Headers.class); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteNonRetry400() { + beginDeleteNonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteNonRetry400Async() { + return beginDeleteNonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteNonRetry400WithServiceResponseAsync() { + return service.beginDeleteNonRetry400(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteNonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteNonRetry400Headers.class); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete202NonRetry400() { + delete202NonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202NonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202NonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202NonRetry400Async() { + return delete202NonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202NonRetry400WithServiceResponseAsync() { + Observable> observable = service.delete202NonRetry400(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDelete202NonRetry400Headers.class); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete202NonRetry400() { + beginDelete202NonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202NonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202NonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDelete202NonRetry400Async() { + return beginDelete202NonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDelete202NonRetry400WithServiceResponseAsync() { + return service.beginDelete202NonRetry400(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202NonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202NonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDelete202NonRetry400Headers.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetry400() { + deleteAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetry400Async() { + return deleteAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetry400WithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetry400(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteAsyncRelativeRetry400Headers.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetry400() { + beginDeleteAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetry400Async() { + return beginDeleteAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetry400WithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetry400(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteAsyncRelativeRetry400Headers.class); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postNonRetry400() { + postNonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postNonRetry400Async() { + return postNonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postNonRetry400WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostNonRetry400Headers.class); + } + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postNonRetry400(Product product) { + postNonRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postNonRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postNonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postNonRetry400Async(Product product) { + return postNonRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postNonRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostNonRetry400Headers.class); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostNonRetry400() { + beginPostNonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostNonRetry400Async() { + return beginPostNonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostNonRetry400WithServiceResponseAsync() { + final Product product = null; + return service.beginPostNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostNonRetry400(Product product) { + beginPostNonRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostNonRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostNonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostNonRetry400Async(Product product) { + return beginPostNonRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostNonRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostNonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostNonRetry400Headers.class); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202NonRetry400() { + post202NonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NonRetry400Async() { + return post202NonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NonRetry400WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.post202NonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202NonRetry400Headers.class); + } + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202NonRetry400(Product product) { + post202NonRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NonRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NonRetry400Async(Product product) { + return post202NonRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NonRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.post202NonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202NonRetry400Headers.class); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202NonRetry400() { + beginPost202NonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202NonRetry400Async() { + return beginPost202NonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202NonRetry400WithServiceResponseAsync() { + final Product product = null; + return service.beginPost202NonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202NonRetry400(Product product) { + beginPost202NonRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NonRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202NonRetry400Async(Product product) { + return beginPost202NonRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202NonRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPost202NonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202NonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPost202NonRetry400Headers.class); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetry400() { + postAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetry400Async() { + return postAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetry400WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetry400Headers.class); + } + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetry400(Product product) { + postAsyncRelativeRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetry400Async(Product product) { + return postAsyncRelativeRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetry400Headers.class); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetry400() { + beginPostAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetry400Async() { + return beginPostAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetry400WithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetry400(Product product) { + beginPostAsyncRelativeRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetry400Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetry400Async(Product product) { + return beginPostAsyncRelativeRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetry400WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostAsyncRelativeRetry400Headers.class); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putError201NoProvisioningStatePayload() { + return putError201NoProvisioningStatePayloadWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putError201NoProvisioningStatePayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putError201NoProvisioningStatePayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putError201NoProvisioningStatePayloadAsync() { + return putError201NoProvisioningStatePayloadWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putError201NoProvisioningStatePayloadWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putError201NoProvisioningStatePayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putError201NoProvisioningStatePayload(Product product) { + return putError201NoProvisioningStatePayloadWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putError201NoProvisioningStatePayloadAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putError201NoProvisioningStatePayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putError201NoProvisioningStatePayloadAsync(Product product) { + return putError201NoProvisioningStatePayloadWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putError201NoProvisioningStatePayloadWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putError201NoProvisioningStatePayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutError201NoProvisioningStatePayload() { + return beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutError201NoProvisioningStatePayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutError201NoProvisioningStatePayloadAsync() { + return beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync() { + final Product product = null; + return service.beginPutError201NoProvisioningStatePayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutError201NoProvisioningStatePayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutError201NoProvisioningStatePayload(Product product) { + return beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutError201NoProvisioningStatePayloadAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutError201NoProvisioningStatePayloadAsync(Product product) { + return beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutError201NoProvisioningStatePayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutError201NoProvisioningStatePayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutError201NoProvisioningStatePayloadDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetryNoStatus() { + return putAsyncRelativeRetryNoStatusWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryNoStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryNoStatusAsync() { + return putAsyncRelativeRetryNoStatusWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryNoStatusWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryNoStatusHeaders.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetryNoStatus(Product product) { + return putAsyncRelativeRetryNoStatusWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryNoStatusAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryNoStatusWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryNoStatusAsync(Product product) { + return putAsyncRelativeRetryNoStatusWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryNoStatusWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryNoStatusHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetryNoStatus() { + return beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetryNoStatusAsync() { + return beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryNoStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetryNoStatus(Product product) { + return beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryNoStatusAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetryNoStatusAsync(Product product) { + return beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryNoStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetryNoStatusDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetryNoStatusHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetryNoStatusPayload() { + return putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryNoStatusPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryNoStatusPayloadAsync() { + return putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRelativeRetryNoStatusPayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetryNoStatusPayload(Product product) { + return putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryNoStatusPayloadAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryNoStatusPayloadAsync(Product product) { + return putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetryNoStatusPayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetryNoStatusPayload() { + return beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryNoStatusPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetryNoStatusPayloadAsync() { + return beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRelativeRetryNoStatusPayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryNoStatusPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetryNoStatusPayload(Product product) { + return beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryNoStatusPayloadAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetryNoStatusPayloadAsync(Product product) { + return beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetryNoStatusPayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryNoStatusPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetryNoStatusPayloadDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.class); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete204Succeeded() { + delete204SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete204SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete204SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete204SucceededAsync() { + return delete204SucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete204SucceededWithServiceResponseAsync() { + Observable> observable = service.delete204Succeeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete204Succeeded() { + beginDelete204SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete204SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDelete204SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDelete204SucceededAsync() { + return beginDelete204SucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDelete204SucceededWithServiceResponseAsync() { + return service.beginDelete204Succeeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDelete204SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDelete204SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetryNoStatus() { + deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetryNoStatusAsync() { + return deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetryNoStatus(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetryNoStatus() { + beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetryNoStatusAsync() { + return beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetryNoStatus(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetryNoStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetryNoStatusDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202NoLocation() { + post202NoLocationWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NoLocationAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NoLocationWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NoLocationAsync() { + return post202NoLocationWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NoLocationWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.post202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202NoLocationHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202NoLocation(Product product) { + post202NoLocationWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NoLocationAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NoLocationWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NoLocationAsync(Product product) { + return post202NoLocationWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NoLocationWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.post202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202NoLocationHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202NoLocation() { + beginPost202NoLocationWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NoLocationAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NoLocationWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202NoLocationAsync() { + return beginPost202NoLocationWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202NoLocationWithServiceResponseAsync() { + final Product product = null; + return service.beginPost202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NoLocationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202NoLocation(Product product) { + beginPost202NoLocationWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NoLocationAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NoLocationWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202NoLocationAsync(Product product) { + return beginPost202NoLocationWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202NoLocationWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPost202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NoLocationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202NoLocationDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPost202NoLocationHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryNoPayload() { + postAsyncRelativeRetryNoPayloadWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryNoPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryNoPayloadAsync() { + return postAsyncRelativeRetryNoPayloadWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryNoPayloadWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRelativeRetryNoPayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryNoPayloadHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryNoPayload(Product product) { + postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryNoPayloadAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryNoPayloadAsync(Product product) { + return postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetryNoPayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryNoPayloadHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryNoPayload() { + beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryNoPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryNoPayloadAsync() { + return beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRelativeRetryNoPayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryNoPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryNoPayload(Product product) { + beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryNoPayloadAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryNoPayloadAsync(Product product) { + return beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetryNoPayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryNoPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetryNoPayloadDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostAsyncRelativeRetryNoPayloadHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200InvalidJson() { + return put200InvalidJsonWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200InvalidJsonAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200InvalidJsonWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200InvalidJsonAsync() { + return put200InvalidJsonWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200InvalidJsonWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put200InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200InvalidJson(Product product) { + return put200InvalidJsonWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200InvalidJsonAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200InvalidJsonWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200InvalidJsonAsync(Product product) { + return put200InvalidJsonWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200InvalidJsonWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put200InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200InvalidJson() { + return beginPut200InvalidJsonWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200InvalidJsonAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200InvalidJsonWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200InvalidJsonAsync() { + return beginPut200InvalidJsonWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200InvalidJsonWithServiceResponseAsync() { + final Product product = null; + return service.beginPut200InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200InvalidJsonDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200InvalidJson(Product product) { + return beginPut200InvalidJsonWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200InvalidJsonAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200InvalidJsonWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200InvalidJsonAsync(Product product) { + return beginPut200InvalidJsonWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200InvalidJsonWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut200InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200InvalidJsonDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200InvalidJsonDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetryInvalidHeader() { + return putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryInvalidHeaderAsync() { + return putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetryInvalidHeader(Product product) { + return putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryInvalidHeaderAsync(Product product) { + return putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetryInvalidHeader() { + return beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetryInvalidHeaderAsync() { + return beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetryInvalidHeader(Product product) { + return beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetryInvalidHeaderAsync(Product product) { + return beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetryInvalidJsonPolling() { + return putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryInvalidJsonPollingAsync() { + return putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRelativeRetryInvalidJsonPolling(Product product) { + return putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryInvalidJsonPollingAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryInvalidJsonPollingAsync(Product product) { + return putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetryInvalidJsonPolling() { + return beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetryInvalidJsonPollingAsync() { + return beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRelativeRetryInvalidJsonPolling(Product product) { + return beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryInvalidJsonPollingAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRelativeRetryInvalidJsonPollingAsync(Product product) { + return beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetryInvalidJsonPollingDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete202RetryInvalidHeader() { + delete202RetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202RetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202RetryInvalidHeaderAsync() { + return delete202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202RetryInvalidHeaderWithServiceResponseAsync() { + Observable> observable = service.delete202RetryInvalidHeader(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDelete202RetryInvalidHeaderHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete202RetryInvalidHeader() { + beginDelete202RetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202RetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDelete202RetryInvalidHeaderAsync() { + return beginDelete202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDelete202RetryInvalidHeaderWithServiceResponseAsync() { + return service.beginDelete202RetryInvalidHeader(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202RetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202RetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDelete202RetryInvalidHeaderHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetryInvalidHeader() { + deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetryInvalidHeaderAsync() { + return deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetryInvalidHeader(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetryInvalidHeader() { + beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetryInvalidHeaderAsync() { + return beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetryInvalidHeader(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetryInvalidJsonPolling() { + deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetryInvalidJsonPollingAsync() { + return deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetryInvalidJsonPolling(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetryInvalidJsonPolling() { + beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetryInvalidJsonPollingAsync() { + return beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetryInvalidJsonPolling(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetryInvalidJsonPollingDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202RetryInvalidHeader() { + post202RetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202RetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202RetryInvalidHeaderAsync() { + return post202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202RetryInvalidHeaderWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.post202RetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202RetryInvalidHeaderHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202RetryInvalidHeader(Product product) { + post202RetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202RetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202RetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202RetryInvalidHeaderAsync(Product product) { + return post202RetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202RetryInvalidHeaderWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.post202RetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202RetryInvalidHeaderHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202RetryInvalidHeader() { + beginPost202RetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202RetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202RetryInvalidHeaderAsync() { + return beginPost202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202RetryInvalidHeaderWithServiceResponseAsync() { + final Product product = null; + return service.beginPost202RetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202RetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202RetryInvalidHeader(Product product) { + beginPost202RetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202RetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202RetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202RetryInvalidHeaderAsync(Product product) { + return beginPost202RetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202RetryInvalidHeaderWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPost202RetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202RetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202RetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPost202RetryInvalidHeaderHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryInvalidHeader() { + postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryInvalidHeaderAsync() { + return postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryInvalidHeader(Product product) { + postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryInvalidHeaderAsync(Product product) { + return postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryInvalidHeader() { + beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryInvalidHeaderAsync() { + return beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryInvalidHeader(Product product) { + beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryInvalidHeaderAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryInvalidHeaderAsync(Product product) { + return beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryInvalidJsonPolling() { + postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryInvalidJsonPollingAsync() { + return postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryInvalidJsonPolling(Product product) { + postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryInvalidJsonPollingAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryInvalidJsonPollingAsync(Product product) { + return postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryInvalidJsonPolling() { + beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryInvalidJsonPollingAsync() { + return beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryInvalidJsonPolling(Product product) { + beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryInvalidJsonPollingAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryInvalidJsonPollingAsync(Product product) { + return beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetryInvalidJsonPollingDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.class); + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/implementation/LROsCustomHeadersImpl.java b/test/azure/src/main/java/fixtures/lro/implementation/LROsCustomHeadersImpl.java new file mode 100644 index 0000000000..3c2e78a8d2 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/implementation/LROsCustomHeadersImpl.java @@ -0,0 +1,1026 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import retrofit2.Retrofit; +import fixtures.lro.LROsCustomHeaders; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import fixtures.lro.models.LROsCustomHeaderPost202Retry200Headers; +import fixtures.lro.models.LROsCustomHeaderPostAsyncRetrySucceededHeaders; +import fixtures.lro.models.LROsCustomHeaderPutAsyncRetrySucceededHeaders; +import fixtures.lro.models.Product; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROsCustomHeaders. + */ +public class LROsCustomHeadersImpl implements LROsCustomHeaders { + /** The Retrofit service to perform REST calls. */ + private LROsCustomHeadersService service; + /** The service client containing this operation class. */ + private AutoRestLongRunningOperationTestServiceImpl client; + + /** + * Initializes an instance of LROsCustomHeadersImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LROsCustomHeadersImpl(Retrofit retrofit, AutoRestLongRunningOperationTestServiceImpl client) { + this.service = retrofit.create(LROsCustomHeadersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LROsCustomHeaders to be + * used by Retrofit to perform actually REST calls. + */ + interface LROsCustomHeadersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders putAsyncRetrySucceeded" }) + @PUT("lro/customheader/putasync/retry/succeeded") + Observable> putAsyncRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders beginPutAsyncRetrySucceeded" }) + @PUT("lro/customheader/putasync/retry/succeeded") + Observable> beginPutAsyncRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders put201CreatingSucceeded200" }) + @PUT("lro/customheader/put/201/creating/succeeded/200") + Observable> put201CreatingSucceeded200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders beginPut201CreatingSucceeded200" }) + @PUT("lro/customheader/put/201/creating/succeeded/200") + Observable> beginPut201CreatingSucceeded200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders post202Retry200" }) + @POST("lro/customheader/post/202/retry/200") + Observable> post202Retry200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders beginPost202Retry200" }) + @POST("lro/customheader/post/202/retry/200") + Observable> beginPost202Retry200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders postAsyncRetrySucceeded" }) + @POST("lro/customheader/postasync/retry/succeeded") + Observable> postAsyncRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders beginPostAsyncRetrySucceeded" }) + @POST("lro/customheader/postasync/retry/succeeded") + Observable> beginPostAsyncRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRetrySucceeded() { + return putAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetrySucceededAsync() { + return putAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetrySucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPutAsyncRetrySucceededHeaders.class); + } + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRetrySucceeded(Product product) { + return putAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetrySucceededAsync(Product product) { + return putAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPutAsyncRetrySucceededHeaders.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRetrySucceeded() { + return beginPutAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRetrySucceededAsync() { + return beginPutAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRetrySucceeded(Product product) { + return beginPutAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRetrySucceededAsync(Product product) { + return beginPutAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsCustomHeaderPutAsyncRetrySucceededHeaders.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put201CreatingSucceeded200() { + return put201CreatingSucceeded200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async() { + return put201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put201CreatingSucceeded200(Product product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async(Product product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut201CreatingSucceeded200() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut201CreatingSucceeded200Async() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync() { + final Product product = null; + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut201CreatingSucceeded200(Product product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut201CreatingSucceeded200Async(Product product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut201CreatingSucceeded200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200() { + post202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async() { + return post202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPost202Retry200Headers.class); + } + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200(Product product) { + post202Retry200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async(Product product) { + return post202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPost202Retry200Headers.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200() { + beginPost202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async() { + return beginPost202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync() { + final Product product = null; + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200(Product product) { + beginPost202Retry200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async(Product product) { + return beginPost202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsCustomHeaderPost202Retry200Headers.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetrySucceeded() { + postAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrySucceededAsync() { + return postAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrySucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPostAsyncRetrySucceededHeaders.class); + } + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetrySucceeded(Product product) { + postAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrySucceededAsync(Product product) { + return postAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPostAsyncRetrySucceededHeaders.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetrySucceeded() { + beginPostAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetrySucceededAsync() { + return beginPostAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetrySucceeded(Product product) { + beginPostAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetrySucceededAsync(Product product) { + return beginPostAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsCustomHeaderPostAsyncRetrySucceededHeaders.class); + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/implementation/LROsImpl.java b/test/azure/src/main/java/fixtures/lro/implementation/LROsImpl.java new file mode 100644 index 0000000000..dc2f4e462d --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/implementation/LROsImpl.java @@ -0,0 +1,7240 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import retrofit2.Retrofit; +import fixtures.lro.LROs; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import fixtures.lro.models.LROsDelete202NoRetry204Headers; +import fixtures.lro.models.LROsDelete202Retry200Headers; +import fixtures.lro.models.LROsDeleteAsyncNoHeaderInRetryHeaders; +import fixtures.lro.models.LROsDeleteAsyncNoRetrySucceededHeaders; +import fixtures.lro.models.LROsDeleteAsyncRetrycanceledHeaders; +import fixtures.lro.models.LROsDeleteAsyncRetryFailedHeaders; +import fixtures.lro.models.LROsDeleteAsyncRetrySucceededHeaders; +import fixtures.lro.models.LROsDeleteNoHeaderInRetryHeaders; +import fixtures.lro.models.LROsDeleteProvisioning202Accepted200SucceededHeaders; +import fixtures.lro.models.LROsDeleteProvisioning202Deletingcanceled200Headers; +import fixtures.lro.models.LROsDeleteProvisioning202DeletingFailed200Headers; +import fixtures.lro.models.LROsPost202NoRetry204Headers; +import fixtures.lro.models.LROsPost202Retry200Headers; +import fixtures.lro.models.LROsPostAsyncNoRetrySucceededHeaders; +import fixtures.lro.models.LROsPostAsyncRetrycanceledHeaders; +import fixtures.lro.models.LROsPostAsyncRetryFailedHeaders; +import fixtures.lro.models.LROsPostAsyncRetrySucceededHeaders; +import fixtures.lro.models.LROsPutAsyncNoHeaderInRetryHeaders; +import fixtures.lro.models.LROsPutAsyncNoRetrycanceledHeaders; +import fixtures.lro.models.LROsPutAsyncNoRetrySucceededHeaders; +import fixtures.lro.models.LROsPutAsyncRetryFailedHeaders; +import fixtures.lro.models.LROsPutAsyncRetrySucceededHeaders; +import fixtures.lro.models.LROsPutNoHeaderInRetryHeaders; +import fixtures.lro.models.Product; +import fixtures.lro.models.Sku; +import fixtures.lro.models.SubProduct; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROs. + */ +public class LROsImpl implements LROs { + /** The Retrofit service to perform REST calls. */ + private LROsService service; + /** The service client containing this operation class. */ + private AutoRestLongRunningOperationTestServiceImpl client; + + /** + * Initializes an instance of LROsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LROsImpl(Retrofit retrofit, AutoRestLongRunningOperationTestServiceImpl client) { + this.service = retrofit.create(LROsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LROs to be + * used by Retrofit to perform actually REST calls. + */ + interface LROsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put200Succeeded" }) + @PUT("lro/put/200/succeeded") + Observable> put200Succeeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut200Succeeded" }) + @PUT("lro/put/200/succeeded") + Observable> beginPut200Succeeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put200SucceededNoState" }) + @PUT("lro/put/200/succeeded/nostate") + Observable> put200SucceededNoState(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut200SucceededNoState" }) + @PUT("lro/put/200/succeeded/nostate") + Observable> beginPut200SucceededNoState(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put202Retry200" }) + @PUT("lro/put/202/retry/200") + Observable> put202Retry200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut202Retry200" }) + @PUT("lro/put/202/retry/200") + Observable> beginPut202Retry200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put201CreatingSucceeded200" }) + @PUT("lro/put/201/creating/succeeded/200") + Observable> put201CreatingSucceeded200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut201CreatingSucceeded200" }) + @PUT("lro/put/201/creating/succeeded/200") + Observable> beginPut201CreatingSucceeded200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put200UpdatingSucceeded204" }) + @PUT("lro/put/200/updating/succeeded/200") + Observable> put200UpdatingSucceeded204(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut200UpdatingSucceeded204" }) + @PUT("lro/put/200/updating/succeeded/200") + Observable> beginPut200UpdatingSucceeded204(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put201CreatingFailed200" }) + @PUT("lro/put/201/created/failed/200") + Observable> put201CreatingFailed200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut201CreatingFailed200" }) + @PUT("lro/put/201/created/failed/200") + Observable> beginPut201CreatingFailed200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put200Acceptedcanceled200" }) + @PUT("lro/put/200/accepted/canceled/200") + Observable> put200Acceptedcanceled200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut200Acceptedcanceled200" }) + @PUT("lro/put/200/accepted/canceled/200") + Observable> beginPut200Acceptedcanceled200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putNoHeaderInRetry" }) + @PUT("lro/put/noheader/202/200") + Observable> putNoHeaderInRetry(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutNoHeaderInRetry" }) + @PUT("lro/put/noheader/202/200") + Observable> beginPutNoHeaderInRetry(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncRetrySucceeded" }) + @PUT("lro/putasync/retry/succeeded") + Observable> putAsyncRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncRetrySucceeded" }) + @PUT("lro/putasync/retry/succeeded") + Observable> beginPutAsyncRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncNoRetrySucceeded" }) + @PUT("lro/putasync/noretry/succeeded") + Observable> putAsyncNoRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncNoRetrySucceeded" }) + @PUT("lro/putasync/noretry/succeeded") + Observable> beginPutAsyncNoRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncRetryFailed" }) + @PUT("lro/putasync/retry/failed") + Observable> putAsyncRetryFailed(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncRetryFailed" }) + @PUT("lro/putasync/retry/failed") + Observable> beginPutAsyncRetryFailed(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncNoRetrycanceled" }) + @PUT("lro/putasync/noretry/canceled") + Observable> putAsyncNoRetrycanceled(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncNoRetrycanceled" }) + @PUT("lro/putasync/noretry/canceled") + Observable> beginPutAsyncNoRetrycanceled(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncNoHeaderInRetry" }) + @PUT("lro/putasync/noheader/201/200") + Observable> putAsyncNoHeaderInRetry(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncNoHeaderInRetry" }) + @PUT("lro/putasync/noheader/201/200") + Observable> beginPutAsyncNoHeaderInRetry(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putNonResource" }) + @PUT("lro/putnonresource/202/200") + Observable> putNonResource(@Body Sku sku, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutNonResource" }) + @PUT("lro/putnonresource/202/200") + Observable> beginPutNonResource(@Body Sku sku, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncNonResource" }) + @PUT("lro/putnonresourceasync/202/200") + Observable> putAsyncNonResource(@Body Sku sku, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncNonResource" }) + @PUT("lro/putnonresourceasync/202/200") + Observable> beginPutAsyncNonResource(@Body Sku sku, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putSubResource" }) + @PUT("lro/putsubresource/202/200") + Observable> putSubResource(@Body SubProduct product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutSubResource" }) + @PUT("lro/putsubresource/202/200") + Observable> beginPutSubResource(@Body SubProduct product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncSubResource" }) + @PUT("lro/putsubresourceasync/202/200") + Observable> putAsyncSubResource(@Body SubProduct product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncSubResource" }) + @PUT("lro/putsubresourceasync/202/200") + Observable> beginPutAsyncSubResource(@Body SubProduct product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteProvisioning202Accepted200Succeeded" }) + @HTTP(path = "lro/delete/provisioning/202/accepted/200/succeeded", method = "DELETE", hasBody = true) + Observable> deleteProvisioning202Accepted200Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteProvisioning202Accepted200Succeeded" }) + @HTTP(path = "lro/delete/provisioning/202/accepted/200/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteProvisioning202Accepted200Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteProvisioning202DeletingFailed200" }) + @HTTP(path = "lro/delete/provisioning/202/deleting/200/failed", method = "DELETE", hasBody = true) + Observable> deleteProvisioning202DeletingFailed200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteProvisioning202DeletingFailed200" }) + @HTTP(path = "lro/delete/provisioning/202/deleting/200/failed", method = "DELETE", hasBody = true) + Observable> beginDeleteProvisioning202DeletingFailed200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteProvisioning202Deletingcanceled200" }) + @HTTP(path = "lro/delete/provisioning/202/deleting/200/canceled", method = "DELETE", hasBody = true) + Observable> deleteProvisioning202Deletingcanceled200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteProvisioning202Deletingcanceled200" }) + @HTTP(path = "lro/delete/provisioning/202/deleting/200/canceled", method = "DELETE", hasBody = true) + Observable> beginDeleteProvisioning202Deletingcanceled200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs delete204Succeeded" }) + @HTTP(path = "lro/delete/204/succeeded", method = "DELETE", hasBody = true) + Observable> delete204Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDelete204Succeeded" }) + @HTTP(path = "lro/delete/204/succeeded", method = "DELETE", hasBody = true) + Observable> beginDelete204Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs delete202Retry200" }) + @HTTP(path = "lro/delete/202/retry/200", method = "DELETE", hasBody = true) + Observable> delete202Retry200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDelete202Retry200" }) + @HTTP(path = "lro/delete/202/retry/200", method = "DELETE", hasBody = true) + Observable> beginDelete202Retry200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs delete202NoRetry204" }) + @HTTP(path = "lro/delete/202/noretry/204", method = "DELETE", hasBody = true) + Observable> delete202NoRetry204(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDelete202NoRetry204" }) + @HTTP(path = "lro/delete/202/noretry/204", method = "DELETE", hasBody = true) + Observable> beginDelete202NoRetry204(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteNoHeaderInRetry" }) + @HTTP(path = "lro/delete/noheader", method = "DELETE", hasBody = true) + Observable> deleteNoHeaderInRetry(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteNoHeaderInRetry" }) + @HTTP(path = "lro/delete/noheader", method = "DELETE", hasBody = true) + Observable> beginDeleteNoHeaderInRetry(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncNoHeaderInRetry" }) + @HTTP(path = "lro/deleteasync/noheader/202/204", method = "DELETE", hasBody = true) + Observable> deleteAsyncNoHeaderInRetry(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncNoHeaderInRetry" }) + @HTTP(path = "lro/deleteasync/noheader/202/204", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncNoHeaderInRetry(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncRetrySucceeded" }) + @HTTP(path = "lro/deleteasync/retry/succeeded", method = "DELETE", hasBody = true) + Observable> deleteAsyncRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncRetrySucceeded" }) + @HTTP(path = "lro/deleteasync/retry/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncNoRetrySucceeded" }) + @HTTP(path = "lro/deleteasync/noretry/succeeded", method = "DELETE", hasBody = true) + Observable> deleteAsyncNoRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncNoRetrySucceeded" }) + @HTTP(path = "lro/deleteasync/noretry/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncNoRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncRetryFailed" }) + @HTTP(path = "lro/deleteasync/retry/failed", method = "DELETE", hasBody = true) + Observable> deleteAsyncRetryFailed(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncRetryFailed" }) + @HTTP(path = "lro/deleteasync/retry/failed", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRetryFailed(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncRetrycanceled" }) + @HTTP(path = "lro/deleteasync/retry/canceled", method = "DELETE", hasBody = true) + Observable> deleteAsyncRetrycanceled(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncRetrycanceled" }) + @HTTP(path = "lro/deleteasync/retry/canceled", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRetrycanceled(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs post200WithPayload" }) + @POST("lro/post/payload/200") + Observable> post200WithPayload(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPost200WithPayload" }) + @POST("lro/post/payload/200") + Observable> beginPost200WithPayload(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs post202Retry200" }) + @POST("lro/post/202/retry/200") + Observable> post202Retry200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPost202Retry200" }) + @POST("lro/post/202/retry/200") + Observable> beginPost202Retry200(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs post202NoRetry204" }) + @POST("lro/post/202/noretry/204") + Observable> post202NoRetry204(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPost202NoRetry204" }) + @POST("lro/post/202/noretry/204") + Observable> beginPost202NoRetry204(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs postAsyncRetrySucceeded" }) + @POST("lro/postasync/retry/succeeded") + Observable> postAsyncRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPostAsyncRetrySucceeded" }) + @POST("lro/postasync/retry/succeeded") + Observable> beginPostAsyncRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs postAsyncNoRetrySucceeded" }) + @POST("lro/postasync/noretry/succeeded") + Observable> postAsyncNoRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPostAsyncNoRetrySucceeded" }) + @POST("lro/postasync/noretry/succeeded") + Observable> beginPostAsyncNoRetrySucceeded(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs postAsyncRetryFailed" }) + @POST("lro/postasync/retry/failed") + Observable> postAsyncRetryFailed(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPostAsyncRetryFailed" }) + @POST("lro/postasync/retry/failed") + Observable> beginPostAsyncRetryFailed(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs postAsyncRetrycanceled" }) + @POST("lro/postasync/retry/canceled") + Observable> postAsyncRetrycanceled(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPostAsyncRetrycanceled" }) + @POST("lro/postasync/retry/canceled") + Observable> beginPostAsyncRetrycanceled(@Body Product product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200Succeeded() { + return put200SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200SucceededAsync() { + return put200SucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200SucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put200Succeeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200Succeeded(Product product) { + return put200SucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200SucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200SucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200SucceededAsync(Product product) { + return put200SucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200SucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put200Succeeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200Succeeded() { + return beginPut200SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200SucceededAsync() { + return beginPut200SucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200SucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPut200Succeeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200Succeeded(Product product) { + return beginPut200SucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200SucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200SucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200SucceededAsync(Product product) { + return beginPut200SucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200SucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut200Succeeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200SucceededNoState() { + return put200SucceededNoStateWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200SucceededNoStateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200SucceededNoStateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200SucceededNoStateAsync() { + return put200SucceededNoStateWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200SucceededNoStateWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put200SucceededNoState(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200SucceededNoState(Product product) { + return put200SucceededNoStateWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200SucceededNoStateAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200SucceededNoStateWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200SucceededNoStateAsync(Product product) { + return put200SucceededNoStateWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200SucceededNoStateWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put200SucceededNoState(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200SucceededNoState() { + return beginPut200SucceededNoStateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200SucceededNoStateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200SucceededNoStateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200SucceededNoStateAsync() { + return beginPut200SucceededNoStateWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200SucceededNoStateWithServiceResponseAsync() { + final Product product = null; + return service.beginPut200SucceededNoState(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200SucceededNoStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200SucceededNoState(Product product) { + return beginPut200SucceededNoStateWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200SucceededNoStateAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200SucceededNoStateWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200SucceededNoStateAsync(Product product) { + return beginPut200SucceededNoStateWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200SucceededNoStateWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut200SucceededNoState(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200SucceededNoStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200SucceededNoStateDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put202Retry200() { + return put202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put202Retry200Async() { + return put202Retry200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put202Retry200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put202Retry200(Product product) { + return put202Retry200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put202Retry200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put202Retry200Async(Product product) { + return put202Retry200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put202Retry200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut202Retry200() { + return beginPut202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut202Retry200Async() { + return beginPut202Retry200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut202Retry200WithServiceResponseAsync() { + final Product product = null; + return service.beginPut202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut202Retry200(Product product) { + return beginPut202Retry200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut202Retry200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut202Retry200Async(Product product) { + return beginPut202Retry200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut202Retry200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put201CreatingSucceeded200() { + return put201CreatingSucceeded200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async() { + return put201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put201CreatingSucceeded200(Product product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async(Product product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut201CreatingSucceeded200() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut201CreatingSucceeded200Async() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync() { + final Product product = null; + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut201CreatingSucceeded200(Product product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut201CreatingSucceeded200Async(Product product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut201CreatingSucceeded200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200UpdatingSucceeded204() { + return put200UpdatingSucceeded204WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200UpdatingSucceeded204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200UpdatingSucceeded204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200UpdatingSucceeded204Async() { + return put200UpdatingSucceeded204WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200UpdatingSucceeded204WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put200UpdatingSucceeded204(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200UpdatingSucceeded204(Product product) { + return put200UpdatingSucceeded204WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200UpdatingSucceeded204Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200UpdatingSucceeded204WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200UpdatingSucceeded204Async(Product product) { + return put200UpdatingSucceeded204WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200UpdatingSucceeded204WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put200UpdatingSucceeded204(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200UpdatingSucceeded204() { + return beginPut200UpdatingSucceeded204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200UpdatingSucceeded204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200UpdatingSucceeded204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200UpdatingSucceeded204Async() { + return beginPut200UpdatingSucceeded204WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200UpdatingSucceeded204WithServiceResponseAsync() { + final Product product = null; + return service.beginPut200UpdatingSucceeded204(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200UpdatingSucceeded204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200UpdatingSucceeded204(Product product) { + return beginPut200UpdatingSucceeded204WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200UpdatingSucceeded204Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200UpdatingSucceeded204WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200UpdatingSucceeded204Async(Product product) { + return beginPut200UpdatingSucceeded204WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200UpdatingSucceeded204WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut200UpdatingSucceeded204(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200UpdatingSucceeded204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200UpdatingSucceeded204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put201CreatingFailed200() { + return put201CreatingFailed200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingFailed200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingFailed200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingFailed200Async() { + return put201CreatingFailed200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingFailed200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put201CreatingFailed200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put201CreatingFailed200(Product product) { + return put201CreatingFailed200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingFailed200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingFailed200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingFailed200Async(Product product) { + return put201CreatingFailed200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingFailed200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put201CreatingFailed200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut201CreatingFailed200() { + return beginPut201CreatingFailed200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingFailed200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingFailed200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut201CreatingFailed200Async() { + return beginPut201CreatingFailed200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut201CreatingFailed200WithServiceResponseAsync() { + final Product product = null; + return service.beginPut201CreatingFailed200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingFailed200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut201CreatingFailed200(Product product) { + return beginPut201CreatingFailed200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingFailed200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingFailed200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut201CreatingFailed200Async(Product product) { + return beginPut201CreatingFailed200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut201CreatingFailed200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut201CreatingFailed200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingFailed200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut201CreatingFailed200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200Acceptedcanceled200() { + return put200Acceptedcanceled200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200Acceptedcanceled200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200Acceptedcanceled200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200Acceptedcanceled200Async() { + return put200Acceptedcanceled200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200Acceptedcanceled200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.put200Acceptedcanceled200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product put200Acceptedcanceled200(Product product) { + return put200Acceptedcanceled200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200Acceptedcanceled200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200Acceptedcanceled200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200Acceptedcanceled200Async(Product product) { + return put200Acceptedcanceled200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200Acceptedcanceled200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.put200Acceptedcanceled200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200Acceptedcanceled200() { + return beginPut200Acceptedcanceled200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200Acceptedcanceled200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200Acceptedcanceled200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200Acceptedcanceled200Async() { + return beginPut200Acceptedcanceled200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200Acceptedcanceled200WithServiceResponseAsync() { + final Product product = null; + return service.beginPut200Acceptedcanceled200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200Acceptedcanceled200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPut200Acceptedcanceled200(Product product) { + return beginPut200Acceptedcanceled200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200Acceptedcanceled200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200Acceptedcanceled200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPut200Acceptedcanceled200Async(Product product) { + return beginPut200Acceptedcanceled200WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPut200Acceptedcanceled200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPut200Acceptedcanceled200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200Acceptedcanceled200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200Acceptedcanceled200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putNoHeaderInRetry() { + return putNoHeaderInRetryWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNoHeaderInRetryAsync() { + return putNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNoHeaderInRetryWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutNoHeaderInRetryHeaders.class); + } + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putNoHeaderInRetry(Product product) { + return putNoHeaderInRetryWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNoHeaderInRetryAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putNoHeaderInRetryWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNoHeaderInRetryAsync(Product product) { + return putNoHeaderInRetryWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNoHeaderInRetryWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutNoHeaderInRetryHeaders.class); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutNoHeaderInRetry() { + return beginPutNoHeaderInRetryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutNoHeaderInRetryAsync() { + return beginPutNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutNoHeaderInRetryWithServiceResponseAsync() { + final Product product = null; + return service.beginPutNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutNoHeaderInRetry(Product product) { + return beginPutNoHeaderInRetryWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNoHeaderInRetryAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutNoHeaderInRetryWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutNoHeaderInRetryAsync(Product product) { + return beginPutNoHeaderInRetryWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutNoHeaderInRetryWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutNoHeaderInRetryDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutNoHeaderInRetryHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRetrySucceeded() { + return putAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetrySucceededAsync() { + return putAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetrySucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncRetrySucceededHeaders.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRetrySucceeded(Product product) { + return putAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetrySucceededAsync(Product product) { + return putAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncRetrySucceededHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRetrySucceeded() { + return beginPutAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRetrySucceededAsync() { + return beginPutAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRetrySucceeded(Product product) { + return beginPutAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRetrySucceededAsync(Product product) { + return beginPutAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncRetrySucceededHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncNoRetrySucceeded() { + return putAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoRetrySucceededAsync() { + return putAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoRetrySucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoRetrySucceededHeaders.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncNoRetrySucceeded(Product product) { + return putAsyncNoRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoRetrySucceededAsync(Product product) { + return putAsyncNoRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoRetrySucceededHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncNoRetrySucceeded() { + return beginPutAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncNoRetrySucceededAsync() { + return beginPutAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncNoRetrySucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncNoRetrySucceeded(Product product) { + return beginPutAsyncNoRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncNoRetrySucceededAsync(Product product) { + return beginPutAsyncNoRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncNoRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncNoRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncNoRetrySucceededHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRetryFailed() { + return putAsyncRetryFailedWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetryFailedAsync() { + return putAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetryFailedWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncRetryFailedHeaders.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncRetryFailed(Product product) { + return putAsyncRetryFailedWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetryFailedAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetryFailedWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetryFailedAsync(Product product) { + return putAsyncRetryFailedWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetryFailedWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncRetryFailedHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRetryFailed() { + return beginPutAsyncRetryFailedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRetryFailedAsync() { + return beginPutAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRetryFailedWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncRetryFailed(Product product) { + return beginPutAsyncRetryFailedWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetryFailedAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetryFailedWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncRetryFailedAsync(Product product) { + return beginPutAsyncRetryFailedWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncRetryFailedWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRetryFailedDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncRetryFailedHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncNoRetrycanceled() { + return putAsyncNoRetrycanceledWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoRetrycanceledAsync() { + return putAsyncNoRetrycanceledWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoRetrycanceledWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncNoRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoRetrycanceledHeaders.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncNoRetrycanceled(Product product) { + return putAsyncNoRetrycanceledWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoRetrycanceledAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoRetrycanceledWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoRetrycanceledAsync(Product product) { + return putAsyncNoRetrycanceledWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoRetrycanceledWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncNoRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoRetrycanceledHeaders.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncNoRetrycanceled() { + return beginPutAsyncNoRetrycanceledWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncNoRetrycanceledAsync() { + return beginPutAsyncNoRetrycanceledWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncNoRetrycanceledWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncNoRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncNoRetrycanceled(Product product) { + return beginPutAsyncNoRetrycanceledWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoRetrycanceledAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoRetrycanceledWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncNoRetrycanceledAsync(Product product) { + return beginPutAsyncNoRetrycanceledWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncNoRetrycanceledWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncNoRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncNoRetrycanceledDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncNoRetrycanceledHeaders.class); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncNoHeaderInRetry() { + return putAsyncNoHeaderInRetryWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoHeaderInRetryAsync() { + return putAsyncNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoHeaderInRetryWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.putAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoHeaderInRetryHeaders.class); + } + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product putAsyncNoHeaderInRetry(Product product) { + return putAsyncNoHeaderInRetryWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoHeaderInRetryAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoHeaderInRetryWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoHeaderInRetryAsync(Product product) { + return putAsyncNoHeaderInRetryWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoHeaderInRetryWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.putAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoHeaderInRetryHeaders.class); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncNoHeaderInRetry() { + return beginPutAsyncNoHeaderInRetryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncNoHeaderInRetryAsync() { + return beginPutAsyncNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncNoHeaderInRetryWithServiceResponseAsync() { + final Product product = null; + return service.beginPutAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPutAsyncNoHeaderInRetry(Product product) { + return beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoHeaderInRetryAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPutAsyncNoHeaderInRetryAsync(Product product) { + return beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPutAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncNoHeaderInRetryDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncNoHeaderInRetryHeaders.class); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku putNonResource() { + return putNonResourceWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonResourceAsync() { + return putNonResourceWithServiceResponseAsync().map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonResourceWithServiceResponseAsync() { + final Sku sku = null; + Observable> observable = service.putNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku putNonResource(Sku sku) { + return putNonResourceWithServiceResponseAsync(sku).toBlocking().last().body(); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonResourceAsync(Sku sku, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonResourceWithServiceResponseAsync(sku), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonResourceAsync(Sku sku) { + return putNonResourceWithServiceResponseAsync(sku).map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonResourceWithServiceResponseAsync(Sku sku) { + Validator.validate(sku); + Observable> observable = service.putNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku beginPutNonResource() { + return beginPutNonResourceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable beginPutNonResourceAsync() { + return beginPutNonResourceWithServiceResponseAsync().map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable> beginPutNonResourceWithServiceResponseAsync() { + final Sku sku = null; + return service.beginPutNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku beginPutNonResource(Sku sku) { + return beginPutNonResourceWithServiceResponseAsync(sku).toBlocking().single().body(); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonResourceAsync(Sku sku, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonResourceWithServiceResponseAsync(sku), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable beginPutNonResourceAsync(Sku sku) { + return beginPutNonResourceWithServiceResponseAsync(sku).map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable> beginPutNonResourceWithServiceResponseAsync(Sku sku) { + Validator.validate(sku); + return service.beginPutNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutNonResourceDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku putAsyncNonResource() { + return putAsyncNonResourceWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNonResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putAsyncNonResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNonResourceAsync() { + return putAsyncNonResourceWithServiceResponseAsync().map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNonResourceWithServiceResponseAsync() { + final Sku sku = null; + Observable> observable = service.putAsyncNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku putAsyncNonResource(Sku sku) { + return putAsyncNonResourceWithServiceResponseAsync(sku).toBlocking().last().body(); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNonResourceAsync(Sku sku, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putAsyncNonResourceWithServiceResponseAsync(sku), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNonResourceAsync(Sku sku) { + return putAsyncNonResourceWithServiceResponseAsync(sku).map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNonResourceWithServiceResponseAsync(Sku sku) { + Validator.validate(sku); + Observable> observable = service.putAsyncNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku beginPutAsyncNonResource() { + return beginPutAsyncNonResourceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNonResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutAsyncNonResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable beginPutAsyncNonResourceAsync() { + return beginPutAsyncNonResourceWithServiceResponseAsync().map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable> beginPutAsyncNonResourceWithServiceResponseAsync() { + final Sku sku = null; + return service.beginPutAsyncNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutAsyncNonResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku beginPutAsyncNonResource(Sku sku) { + return beginPutAsyncNonResourceWithServiceResponseAsync(sku).toBlocking().single().body(); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNonResourceAsync(Sku sku, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutAsyncNonResourceWithServiceResponseAsync(sku), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable beginPutAsyncNonResourceAsync(Sku sku) { + return beginPutAsyncNonResourceWithServiceResponseAsync(sku).map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable> beginPutAsyncNonResourceWithServiceResponseAsync(Sku sku) { + Validator.validate(sku); + return service.beginPutAsyncNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutAsyncNonResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutAsyncNonResourceDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + public SubProduct putSubResource() { + return putSubResourceWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSubResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSubResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putSubResourceAsync() { + return putSubResourceWithServiceResponseAsync().map(new Func1, SubProduct>() { + @Override + public SubProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putSubResourceWithServiceResponseAsync() { + final SubProduct product = null; + Observable> observable = service.putSubResource(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + public SubProduct putSubResource(SubProduct product) { + return putSubResourceWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSubResourceAsync(SubProduct product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSubResourceWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putSubResourceAsync(SubProduct product) { + return putSubResourceWithServiceResponseAsync(product).map(new Func1, SubProduct>() { + @Override + public SubProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putSubResourceWithServiceResponseAsync(SubProduct product) { + Validator.validate(product); + Observable> observable = service.putSubResource(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + public SubProduct beginPutSubResource() { + return beginPutSubResourceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutSubResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutSubResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + public Observable beginPutSubResourceAsync() { + return beginPutSubResourceWithServiceResponseAsync().map(new Func1, SubProduct>() { + @Override + public SubProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + public Observable> beginPutSubResourceWithServiceResponseAsync() { + final SubProduct product = null; + return service.beginPutSubResource(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutSubResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + public SubProduct beginPutSubResource(SubProduct product) { + return beginPutSubResourceWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutSubResourceAsync(SubProduct product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutSubResourceWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + public Observable beginPutSubResourceAsync(SubProduct product) { + return beginPutSubResourceWithServiceResponseAsync(product).map(new Func1, SubProduct>() { + @Override + public SubProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + public Observable> beginPutSubResourceWithServiceResponseAsync(SubProduct product) { + Validator.validate(product); + return service.beginPutSubResource(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutSubResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutSubResourceDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + public SubProduct putAsyncSubResource() { + return putAsyncSubResourceWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncSubResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putAsyncSubResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncSubResourceAsync() { + return putAsyncSubResourceWithServiceResponseAsync().map(new Func1, SubProduct>() { + @Override + public SubProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncSubResourceWithServiceResponseAsync() { + final SubProduct product = null; + Observable> observable = service.putAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + public SubProduct putAsyncSubResource(SubProduct product) { + return putAsyncSubResourceWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncSubResourceAsync(SubProduct product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putAsyncSubResourceWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncSubResourceAsync(SubProduct product) { + return putAsyncSubResourceWithServiceResponseAsync(product).map(new Func1, SubProduct>() { + @Override + public SubProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncSubResourceWithServiceResponseAsync(SubProduct product) { + Validator.validate(product); + Observable> observable = service.putAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + public SubProduct beginPutAsyncSubResource() { + return beginPutAsyncSubResourceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncSubResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutAsyncSubResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + public Observable beginPutAsyncSubResourceAsync() { + return beginPutAsyncSubResourceWithServiceResponseAsync().map(new Func1, SubProduct>() { + @Override + public SubProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + public Observable> beginPutAsyncSubResourceWithServiceResponseAsync() { + final SubProduct product = null; + return service.beginPutAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutAsyncSubResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProduct object if successful. + */ + public SubProduct beginPutAsyncSubResource(SubProduct product) { + return beginPutAsyncSubResourceWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncSubResourceAsync(SubProduct product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutAsyncSubResourceWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + public Observable beginPutAsyncSubResourceAsync(SubProduct product) { + return beginPutAsyncSubResourceWithServiceResponseAsync(product).map(new Func1, SubProduct>() { + @Override + public SubProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProduct object + */ + public Observable> beginPutAsyncSubResourceWithServiceResponseAsync(SubProduct product) { + Validator.validate(product); + return service.beginPutAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutAsyncSubResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutAsyncSubResourceDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product deleteProvisioning202Accepted200Succeeded() { + return deleteProvisioning202Accepted200SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteProvisioning202Accepted200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteProvisioning202Accepted200SucceededAsync() { + return deleteProvisioning202Accepted200SucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteProvisioning202Accepted200SucceededWithServiceResponseAsync() { + Observable> observable = service.deleteProvisioning202Accepted200Succeeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteProvisioning202Accepted200SucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginDeleteProvisioning202Accepted200Succeeded() { + return beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginDeleteProvisioning202Accepted200SucceededAsync() { + return beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync() { + return service.beginDeleteProvisioning202Accepted200Succeeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteProvisioning202Accepted200SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteProvisioning202Accepted200SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteProvisioning202Accepted200SucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product deleteProvisioning202DeletingFailed200() { + return deleteProvisioning202DeletingFailed200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProvisioning202DeletingFailed200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteProvisioning202DeletingFailed200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteProvisioning202DeletingFailed200Async() { + return deleteProvisioning202DeletingFailed200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteProvisioning202DeletingFailed200WithServiceResponseAsync() { + Observable> observable = service.deleteProvisioning202DeletingFailed200(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteProvisioning202DeletingFailed200Headers.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginDeleteProvisioning202DeletingFailed200() { + return beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteProvisioning202DeletingFailed200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginDeleteProvisioning202DeletingFailed200Async() { + return beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync() { + return service.beginDeleteProvisioning202DeletingFailed200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteProvisioning202DeletingFailed200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteProvisioning202DeletingFailed200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteProvisioning202DeletingFailed200Headers.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product deleteProvisioning202Deletingcanceled200() { + return deleteProvisioning202Deletingcanceled200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProvisioning202Deletingcanceled200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteProvisioning202Deletingcanceled200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteProvisioning202Deletingcanceled200Async() { + return deleteProvisioning202Deletingcanceled200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteProvisioning202Deletingcanceled200WithServiceResponseAsync() { + Observable> observable = service.deleteProvisioning202Deletingcanceled200(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteProvisioning202Deletingcanceled200Headers.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginDeleteProvisioning202Deletingcanceled200() { + return beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteProvisioning202Deletingcanceled200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginDeleteProvisioning202Deletingcanceled200Async() { + return beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync() { + return service.beginDeleteProvisioning202Deletingcanceled200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteProvisioning202Deletingcanceled200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteProvisioning202Deletingcanceled200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteProvisioning202Deletingcanceled200Headers.class); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete204Succeeded() { + delete204SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete succeeds and returns right away. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete204SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete204SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete204SucceededAsync() { + return delete204SucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete204SucceededWithServiceResponseAsync() { + Observable> observable = service.delete204Succeeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete204Succeeded() { + beginDelete204SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete succeeds and returns right away. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete204SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDelete204SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDelete204SucceededAsync() { + return beginDelete204SucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDelete204SucceededWithServiceResponseAsync() { + return service.beginDelete204Succeeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDelete204SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDelete204SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product delete202Retry200() { + return delete202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202Retry200Async() { + return delete202Retry200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202Retry200WithServiceResponseAsync() { + Observable> observable = service.delete202Retry200(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDelete202Retry200Headers.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginDelete202Retry200() { + return beginDelete202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginDelete202Retry200Async() { + return beginDelete202Retry200WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginDelete202Retry200WithServiceResponseAsync() { + return service.beginDelete202Retry200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDelete202Retry200Headers.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product delete202NoRetry204() { + return delete202NoRetry204WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202NoRetry204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202NoRetry204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202NoRetry204Async() { + return delete202NoRetry204WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202NoRetry204WithServiceResponseAsync() { + Observable> observable = service.delete202NoRetry204(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDelete202NoRetry204Headers.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginDelete202NoRetry204() { + return beginDelete202NoRetry204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202NoRetry204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202NoRetry204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginDelete202NoRetry204Async() { + return beginDelete202NoRetry204WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginDelete202NoRetry204WithServiceResponseAsync() { + return service.beginDelete202NoRetry204(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202NoRetry204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202NoRetry204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDelete202NoRetry204Headers.class); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteNoHeaderInRetry() { + deleteNoHeaderInRetryWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteNoHeaderInRetryAsync() { + return deleteNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteNoHeaderInRetryWithServiceResponseAsync() { + Observable> observable = service.deleteNoHeaderInRetry(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteNoHeaderInRetryHeaders.class); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteNoHeaderInRetry() { + beginDeleteNoHeaderInRetryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteNoHeaderInRetryAsync() { + return beginDeleteNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteNoHeaderInRetryWithServiceResponseAsync() { + return service.beginDeleteNoHeaderInRetry(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteNoHeaderInRetryDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteNoHeaderInRetryHeaders.class); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncNoHeaderInRetry() { + deleteAsyncNoHeaderInRetryWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncNoHeaderInRetryAsync() { + return deleteAsyncNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncNoHeaderInRetryWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncNoHeaderInRetry(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncNoHeaderInRetryHeaders.class); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncNoHeaderInRetry() { + beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncNoHeaderInRetryAsync() { + return beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync() { + return service.beginDeleteAsyncNoHeaderInRetry(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncNoHeaderInRetryDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncNoHeaderInRetryHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRetrySucceeded() { + deleteAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRetrySucceededAsync() { + return deleteAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRetrySucceededWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncRetrySucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRetrySucceeded() { + beginDeleteAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRetrySucceededAsync() { + return beginDeleteAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRetrySucceededWithServiceResponseAsync() { + return service.beginDeleteAsyncRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncRetrySucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncNoRetrySucceeded() { + deleteAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncNoRetrySucceededAsync() { + return deleteAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncNoRetrySucceededWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncNoRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncNoRetrySucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncNoRetrySucceeded() { + beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncNoRetrySucceededAsync() { + return beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync() { + return service.beginDeleteAsyncNoRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncNoRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncNoRetrySucceededHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRetryFailed() { + deleteAsyncRetryFailedWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRetryFailedAsync() { + return deleteAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRetryFailedWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRetryFailed(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncRetryFailedHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRetryFailed() { + beginDeleteAsyncRetryFailedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRetryFailedAsync() { + return beginDeleteAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRetryFailedWithServiceResponseAsync() { + return service.beginDeleteAsyncRetryFailed(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRetryFailedDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncRetryFailedHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRetrycanceled() { + deleteAsyncRetrycanceledWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRetrycanceledAsync() { + return deleteAsyncRetrycanceledWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRetrycanceledWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRetrycanceled(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncRetrycanceledHeaders.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRetrycanceled() { + beginDeleteAsyncRetrycanceledWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRetrycanceledAsync() { + return beginDeleteAsyncRetrycanceledWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRetrycanceledWithServiceResponseAsync() { + return service.beginDeleteAsyncRetrycanceled(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRetrycanceledDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncRetrycanceledHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku post200WithPayload() { + return post200WithPayloadWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post200WithPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post200WithPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post200WithPayloadAsync() { + return post200WithPayloadWithServiceResponseAsync().map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post200WithPayloadWithServiceResponseAsync() { + Observable> observable = service.post200WithPayload(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Sku object if successful. + */ + public Sku beginPost200WithPayload() { + return beginPost200WithPayloadWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost200WithPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPost200WithPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable beginPost200WithPayloadAsync() { + return beginPost200WithPayloadWithServiceResponseAsync().map(new Func1, Sku>() { + @Override + public Sku call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Sku object + */ + public Observable> beginPost200WithPayloadWithServiceResponseAsync() { + return service.beginPost200WithPayload(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPost200WithPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPost200WithPayloadDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200() { + post202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async() { + return post202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPost202Retry200Headers.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200(Product product) { + post202Retry200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async(Product product) { + return post202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPost202Retry200Headers.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200() { + beginPost202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async() { + return beginPost202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync() { + final Product product = null; + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200(Product product) { + beginPost202Retry200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async(Product product) { + return beginPost202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPost202Retry200Headers.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product post202NoRetry204() { + return post202NoRetry204WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NoRetry204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NoRetry204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NoRetry204Async() { + return post202NoRetry204WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NoRetry204WithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.post202NoRetry204(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPost202NoRetry204Headers.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product post202NoRetry204(Product product) { + return post202NoRetry204WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NoRetry204Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NoRetry204WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NoRetry204Async(Product product) { + return post202NoRetry204WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NoRetry204WithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.post202NoRetry204(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPost202NoRetry204Headers.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPost202NoRetry204() { + return beginPost202NoRetry204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NoRetry204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NoRetry204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPost202NoRetry204Async() { + return beginPost202NoRetry204WithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPost202NoRetry204WithServiceResponseAsync() { + final Product product = null; + return service.beginPost202NoRetry204(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NoRetry204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPost202NoRetry204(Product product) { + return beginPost202NoRetry204WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NoRetry204Async(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NoRetry204WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPost202NoRetry204Async(Product product) { + return beginPost202NoRetry204WithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPost202NoRetry204WithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPost202NoRetry204(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NoRetry204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202NoRetry204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPost202NoRetry204Headers.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product postAsyncRetrySucceeded() { + return postAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrySucceededAsync() { + return postAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrySucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetrySucceededHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product postAsyncRetrySucceeded(Product product) { + return postAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrySucceededAsync(Product product) { + return postAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetrySucceededHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPostAsyncRetrySucceeded() { + return beginPostAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPostAsyncRetrySucceededAsync() { + return beginPostAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPostAsyncRetrySucceeded(Product product) { + return beginPostAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPostAsyncRetrySucceededAsync(Product product) { + return beginPostAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPostAsyncRetrySucceededHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product postAsyncNoRetrySucceeded() { + return postAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncNoRetrySucceededAsync() { + return postAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncNoRetrySucceededWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncNoRetrySucceededHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product postAsyncNoRetrySucceeded(Product product) { + return postAsyncNoRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncNoRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncNoRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncNoRetrySucceededAsync(Product product) { + return postAsyncNoRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncNoRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncNoRetrySucceededHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPostAsyncNoRetrySucceeded() { + return beginPostAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPostAsyncNoRetrySucceededAsync() { + return beginPostAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPostAsyncNoRetrySucceededWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product beginPostAsyncNoRetrySucceeded(Product product) { + return beginPostAsyncNoRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncNoRetrySucceededAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncNoRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable beginPostAsyncNoRetrySucceededAsync(Product product) { + return beginPostAsyncNoRetrySucceededWithServiceResponseAsync(product).map(new Func1, Product>() { + @Override + public Product call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> beginPostAsyncNoRetrySucceededWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncNoRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPostAsyncNoRetrySucceededHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetryFailed() { + postAsyncRetryFailedWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetryFailedAsync() { + return postAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetryFailedWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetryFailedHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetryFailed(Product product) { + postAsyncRetryFailedWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetryFailedAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetryFailedWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetryFailedAsync(Product product) { + return postAsyncRetryFailedWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetryFailedWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetryFailedHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetryFailed() { + beginPostAsyncRetryFailedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetryFailedAsync() { + return beginPostAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetryFailedWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetryFailed(Product product) { + beginPostAsyncRetryFailedWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetryFailedAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetryFailedWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetryFailedAsync(Product product) { + return beginPostAsyncRetryFailedWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetryFailedWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRetryFailedDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPostAsyncRetryFailedHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetrycanceled() { + postAsyncRetrycanceledWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrycanceledAsync() { + return postAsyncRetrycanceledWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrycanceledWithServiceResponseAsync() { + final Product product = null; + Observable> observable = service.postAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetrycanceledHeaders.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetrycanceled(Product product) { + postAsyncRetrycanceledWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrycanceledAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrycanceledWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrycanceledAsync(Product product) { + return postAsyncRetrycanceledWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrycanceledWithServiceResponseAsync(Product product) { + Validator.validate(product); + Observable> observable = service.postAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetrycanceledHeaders.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetrycanceled() { + beginPostAsyncRetrycanceledWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetrycanceledAsync() { + return beginPostAsyncRetrycanceledWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetrycanceledWithServiceResponseAsync() { + final Product product = null; + return service.beginPostAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetrycanceled(Product product) { + beginPostAsyncRetrycanceledWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrycanceledAsync(Product product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrycanceledWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetrycanceledAsync(Product product) { + return beginPostAsyncRetrycanceledWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetrycanceledWithServiceResponseAsync(Product product) { + Validator.validate(product); + return service.beginPostAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRetrycanceledDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPostAsyncRetrycanceledHeaders.class); + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/implementation/package-info.java b/test/azure/src/main/java/fixtures/lro/implementation/package-info.java new file mode 100644 index 0000000000..8f0b083f87 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestLongRunningOperationTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.lro.implementation; diff --git a/test/azure/src/main/java/fixtures/lro/models/LRORetrysDelete202Retry200Headers.java b/test/azure/src/main/java/fixtures/lro/models/LRORetrysDelete202Retry200Headers.java new file mode 100644 index 0000000000..3c7d371828 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LRORetrysDelete202Retry200Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202Retry200 operation. + */ +public class LRORetrysDelete202Retry200Headers { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/delete/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysDelete202Retry200Headers object itself. + */ + public LRORetrysDelete202Retry200Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysDelete202Retry200Headers object itself. + */ + public LRORetrysDelete202Retry200Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.java new file mode 100644 index 0000000000..e94ae9dd44 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LRORetrysDeleteAsyncRelativeRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetrySucceeded operation. + */ +public class LRORetrysDeleteAsyncRelativeRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/retryerror/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LRORetrysDeleteAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysDeleteAsyncRelativeRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysDeleteAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysDeleteAsyncRelativeRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysDeleteAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysDeleteAsyncRelativeRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.java new file mode 100644 index 0000000000..418b001d1e --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LRORetrysDeleteProvisioning202Accepted200SucceededHeaders.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteProvisioning202Accepted200Succeeded operation. + */ +public class LRORetrysDeleteProvisioning202Accepted200SucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/delete/provisioning/202/accepted/200/succeeded. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysDeleteProvisioning202Accepted200SucceededHeaders object itself. + */ + public LRORetrysDeleteProvisioning202Accepted200SucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysDeleteProvisioning202Accepted200SucceededHeaders object itself. + */ + public LRORetrysDeleteProvisioning202Accepted200SucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LRORetrysPost202Retry200Headers.java b/test/azure/src/main/java/fixtures/lro/models/LRORetrysPost202Retry200Headers.java new file mode 100644 index 0000000000..3ab66a681f --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LRORetrysPost202Retry200Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202Retry200 operation. + */ +public class LRORetrysPost202Retry200Headers { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysPost202Retry200Headers object itself. + */ + public LRORetrysPost202Retry200Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysPost202Retry200Headers object itself. + */ + public LRORetrysPost202Retry200Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LRORetrysPostAsyncRelativeRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LRORetrysPostAsyncRelativeRetrySucceededHeaders.java new file mode 100644 index 0000000000..fbd30f949b --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LRORetrysPostAsyncRelativeRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetrySucceeded operation. + */ +public class LRORetrysPostAsyncRelativeRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/retryerror/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LRORetrysPostAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysPostAsyncRelativeRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysPostAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysPostAsyncRelativeRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysPostAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysPostAsyncRelativeRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LRORetrysPutAsyncRelativeRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LRORetrysPutAsyncRelativeRetrySucceededHeaders.java new file mode 100644 index 0000000000..0a09c66602 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LRORetrysPutAsyncRelativeRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetrySucceeded operation. + */ +public class LRORetrysPutAsyncRelativeRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/retryerror/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LRORetrysPutAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysPutAsyncRelativeRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysPutAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysPutAsyncRelativeRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysPutAsyncRelativeRetrySucceededHeaders object itself. + */ + public LRORetrysPutAsyncRelativeRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsDelete202NonRetry400Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsDelete202NonRetry400Headers.java new file mode 100644 index 0000000000..36bc4a52a1 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsDelete202NonRetry400Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202NonRetry400 operation. + */ +public class LROSADsDelete202NonRetry400Headers { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/delete/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDelete202NonRetry400Headers object itself. + */ + public LROSADsDelete202NonRetry400Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDelete202NonRetry400Headers object itself. + */ + public LROSADsDelete202NonRetry400Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsDelete202RetryInvalidHeaderHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsDelete202RetryInvalidHeaderHeaders.java new file mode 100644 index 0000000000..f3d063dcb2 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsDelete202RetryInvalidHeaderHeaders.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202RetryInvalidHeader operation. + */ +public class LROSADsDelete202RetryInvalidHeaderHeaders { + /** + * Location to poll for result status: will be set to /foo. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to /bar. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDelete202RetryInvalidHeaderHeaders object itself. + */ + public LROSADsDelete202RetryInvalidHeaderHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDelete202RetryInvalidHeaderHeaders object itself. + */ + public LROSADsDelete202RetryInvalidHeaderHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetry400Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetry400Headers.java new file mode 100644 index 0000000000..e731b70bfe --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetry400Headers.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetry400 operation. + */ +public class LROSADsDeleteAsyncRelativeRetry400Headers { + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/deleteasync/retry/operationResults/400. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/deleteasync/retry/operationResults/400. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsDeleteAsyncRelativeRetry400Headers object itself. + */ + public LROSADsDeleteAsyncRelativeRetry400Headers withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteAsyncRelativeRetry400Headers object itself. + */ + public LROSADsDeleteAsyncRelativeRetry400Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteAsyncRelativeRetry400Headers object itself. + */ + public LROSADsDeleteAsyncRelativeRetry400Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.java new file mode 100644 index 0000000000..bcb7e3561f --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetryInvalidHeader operation. + */ +public class LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders { + /** + * Location to poll for result status: will be set to /foo. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to /foo. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to /bar. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.java new file mode 100644 index 0000000000..54c3802ce8 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetryInvalidJsonPolling operation. + */ +public class LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders { + /** + * Location to poll for result status: will be set to + * /lro/error/deleteasync/retry/failed/operationResults/invalidjsonpolling. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/error/deleteasync/retry/failed/operationResults/invalidjsonpolling. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.java new file mode 100644 index 0000000000..819de51de2 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteAsyncRelativeRetryNoStatusHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetryNoStatus operation. + */ +public class LROSADsDeleteAsyncRelativeRetryNoStatusHeaders { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsDeleteAsyncRelativeRetryNoStatusHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryNoStatusHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteAsyncRelativeRetryNoStatusHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryNoStatusHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteAsyncRelativeRetryNoStatusHeaders object itself. + */ + public LROSADsDeleteAsyncRelativeRetryNoStatusHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteNonRetry400Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteNonRetry400Headers.java new file mode 100644 index 0000000000..ccb27c5e67 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsDeleteNonRetry400Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteNonRetry400 operation. + */ +public class LROSADsDeleteNonRetry400Headers { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/delete/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteNonRetry400Headers object itself. + */ + public LROSADsDeleteNonRetry400Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteNonRetry400Headers object itself. + */ + public LROSADsDeleteNonRetry400Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202NoLocationHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202NoLocationHeaders.java new file mode 100644 index 0000000000..e879a4615b --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202NoLocationHeaders.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202NoLocation operation. + */ +public class LROSADsPost202NoLocationHeaders { + /** + * Location to poll for result status: will not be set. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPost202NoLocationHeaders object itself. + */ + public LROSADsPost202NoLocationHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPost202NoLocationHeaders object itself. + */ + public LROSADsPost202NoLocationHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202NonRetry400Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202NonRetry400Headers.java new file mode 100644 index 0000000000..b4aa84c010 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202NonRetry400Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202NonRetry400 operation. + */ +public class LROSADsPost202NonRetry400Headers { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPost202NonRetry400Headers object itself. + */ + public LROSADsPost202NonRetry400Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPost202NonRetry400Headers object itself. + */ + public LROSADsPost202NonRetry400Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202RetryInvalidHeaderHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202RetryInvalidHeaderHeaders.java new file mode 100644 index 0000000000..79ff95cb2e --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPost202RetryInvalidHeaderHeaders.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202RetryInvalidHeader operation. + */ +public class LROSADsPost202RetryInvalidHeaderHeaders { + /** + * Location to poll for result status: will be set to /foo. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to /bar. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPost202RetryInvalidHeaderHeaders object itself. + */ + public LROSADsPost202RetryInvalidHeaderHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPost202RetryInvalidHeaderHeaders object itself. + */ + public LROSADsPost202RetryInvalidHeaderHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetry400Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetry400Headers.java new file mode 100644 index 0000000000..d2be9bba76 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetry400Headers.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetry400 operation. + */ +public class LROSADsPostAsyncRelativeRetry400Headers { + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/putasync/retry/operationResults/400. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/putasync/retry/operationResults/400. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPostAsyncRelativeRetry400Headers object itself. + */ + public LROSADsPostAsyncRelativeRetry400Headers withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostAsyncRelativeRetry400Headers object itself. + */ + public LROSADsPostAsyncRelativeRetry400Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostAsyncRelativeRetry400Headers object itself. + */ + public LROSADsPostAsyncRelativeRetry400Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.java new file mode 100644 index 0000000000..936d3791b0 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetryInvalidHeader operation. + */ +public class LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders { + /** + * Location to poll for result status: will be set to foo. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to foo. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to /bar. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidHeaderHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.java new file mode 100644 index 0000000000..b40ab763e1 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetryInvalidJsonPolling operation. + */ +public class LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders { + /** + * Location to poll for result status: will be set to + * /lro/error/postasync/retry/failed/operationResults/invalidjsonpolling. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/error/postasync/retry/failed/operationResults/invalidjsonpolling. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryNoPayloadHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryNoPayloadHeaders.java new file mode 100644 index 0000000000..c2295f65a8 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostAsyncRelativeRetryNoPayloadHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetryNoPayload operation. + */ +public class LROSADsPostAsyncRelativeRetryNoPayloadHeaders { + /** + * Location to poll for result status: will be set to + * /lro/error/putasync/retry/failed/operationResults/nopayload. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/error/putasync/retry/failed/operationResults/nopayload. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPostAsyncRelativeRetryNoPayloadHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryNoPayloadHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostAsyncRelativeRetryNoPayloadHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryNoPayloadHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostAsyncRelativeRetryNoPayloadHeaders object itself. + */ + public LROSADsPostAsyncRelativeRetryNoPayloadHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPostNonRetry400Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostNonRetry400Headers.java new file mode 100644 index 0000000000..be98f46cd2 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPostNonRetry400Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postNonRetry400 operation. + */ +public class LROSADsPostNonRetry400Headers { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostNonRetry400Headers object itself. + */ + public LROSADsPostNonRetry400Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostNonRetry400Headers object itself. + */ + public LROSADsPostNonRetry400Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetry400Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetry400Headers.java new file mode 100644 index 0000000000..9a26a8a484 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetry400Headers.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetry400 operation. + */ +public class LROSADsPutAsyncRelativeRetry400Headers { + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/putasync/retry/operationResults/400. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/putasync/retry/operationResults/400. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetry400Headers object itself. + */ + public LROSADsPutAsyncRelativeRetry400Headers withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetry400Headers object itself. + */ + public LROSADsPutAsyncRelativeRetry400Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetry400Headers object itself. + */ + public LROSADsPutAsyncRelativeRetry400Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.java new file mode 100644 index 0000000000..70ede9e6fb --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetryInvalidHeader operation. + */ +public class LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidHeaderHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.java new file mode 100644 index 0000000000..a7f2a94226 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetryInvalidJsonPolling operation. + */ +public class LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryNoStatusHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryNoStatusHeaders.java new file mode 100644 index 0000000000..c2f7f6ae35 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryNoStatusHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetryNoStatus operation. + */ +public class LROSADsPutAsyncRelativeRetryNoStatusHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.java new file mode 100644 index 0000000000..2bba977204 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetryNoStatusPayload operation. + */ +public class LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusPayloadHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPost202Retry200Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPost202Retry200Headers.java new file mode 100644 index 0000000000..986cdb7bd5 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPost202Retry200Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202Retry200 operation. + */ +public class LROsCustomHeaderPost202Retry200Headers { + /** + * Location to poll for result status: will be set to + * /lro/customheader/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsCustomHeaderPost202Retry200Headers object itself. + */ + public LROsCustomHeaderPost202Retry200Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsCustomHeaderPost202Retry200Headers object itself. + */ + public LROsCustomHeaderPost202Retry200Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPostAsyncRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPostAsyncRetrySucceededHeaders.java new file mode 100644 index 0000000000..d99e03a53e --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPostAsyncRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRetrySucceeded operation. + */ +public class LROsCustomHeaderPostAsyncRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/customheader/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/customheader/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsCustomHeaderPostAsyncRetrySucceededHeaders object itself. + */ + public LROsCustomHeaderPostAsyncRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsCustomHeaderPostAsyncRetrySucceededHeaders object itself. + */ + public LROsCustomHeaderPostAsyncRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsCustomHeaderPostAsyncRetrySucceededHeaders object itself. + */ + public LROsCustomHeaderPostAsyncRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPutAsyncRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPutAsyncRetrySucceededHeaders.java new file mode 100644 index 0000000000..665f64b746 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsCustomHeaderPutAsyncRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRetrySucceeded operation. + */ +public class LROsCustomHeaderPutAsyncRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/customheader/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/customheader/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsCustomHeaderPutAsyncRetrySucceededHeaders object itself. + */ + public LROsCustomHeaderPutAsyncRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsCustomHeaderPutAsyncRetrySucceededHeaders object itself. + */ + public LROsCustomHeaderPutAsyncRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsCustomHeaderPutAsyncRetrySucceededHeaders object itself. + */ + public LROsCustomHeaderPutAsyncRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDelete202NoRetry204Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROsDelete202NoRetry204Headers.java new file mode 100644 index 0000000000..89424b94eb --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDelete202NoRetry204Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202NoRetry204 operation. + */ +public class LROsDelete202NoRetry204Headers { + /** + * Location to poll for result status: will be set to + * /lro/delete/202/noretry/204. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDelete202NoRetry204Headers object itself. + */ + public LROsDelete202NoRetry204Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDelete202NoRetry204Headers object itself. + */ + public LROsDelete202NoRetry204Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDelete202Retry200Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROsDelete202Retry200Headers.java new file mode 100644 index 0000000000..7b2d86e2bc --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDelete202Retry200Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202Retry200 operation. + */ +public class LROsDelete202Retry200Headers { + /** + * Location to poll for result status: will be set to + * /lro/delete/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDelete202Retry200Headers object itself. + */ + public LROsDelete202Retry200Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDelete202Retry200Headers object itself. + */ + public LROsDelete202Retry200Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncNoHeaderInRetryHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncNoHeaderInRetryHeaders.java new file mode 100644 index 0000000000..a135261c3b --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncNoHeaderInRetryHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncNoHeaderInRetry operation. + */ +public class LROsDeleteAsyncNoHeaderInRetryHeaders { + /** + * Location to poll for result status: will be set to + * /lro/put/noheader/202/204/operationresults. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncNoHeaderInRetryHeaders object itself. + */ + public LROsDeleteAsyncNoHeaderInRetryHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncNoRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncNoRetrySucceededHeaders.java new file mode 100644 index 0000000000..1aff4b9d5e --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncNoRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncNoRetrySucceeded operation. + */ +public class LROsDeleteAsyncNoRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/noretry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/noretry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsDeleteAsyncNoRetrySucceededHeaders object itself. + */ + public LROsDeleteAsyncNoRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncNoRetrySucceededHeaders object itself. + */ + public LROsDeleteAsyncNoRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteAsyncNoRetrySucceededHeaders object itself. + */ + public LROsDeleteAsyncNoRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetryFailedHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetryFailedHeaders.java new file mode 100644 index 0000000000..b2bdd9b800 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetryFailedHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRetryFailed operation. + */ +public class LROsDeleteAsyncRetryFailedHeaders { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsDeleteAsyncRetryFailedHeaders object itself. + */ + public LROsDeleteAsyncRetryFailedHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncRetryFailedHeaders object itself. + */ + public LROsDeleteAsyncRetryFailedHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteAsyncRetryFailedHeaders object itself. + */ + public LROsDeleteAsyncRetryFailedHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetrySucceededHeaders.java new file mode 100644 index 0000000000..bf74e5f1e3 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRetrySucceeded operation. + */ +public class LROsDeleteAsyncRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsDeleteAsyncRetrySucceededHeaders object itself. + */ + public LROsDeleteAsyncRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncRetrySucceededHeaders object itself. + */ + public LROsDeleteAsyncRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteAsyncRetrySucceededHeaders object itself. + */ + public LROsDeleteAsyncRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetrycanceledHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetrycanceledHeaders.java new file mode 100644 index 0000000000..bd68732898 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteAsyncRetrycanceledHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRetrycanceled operation. + */ +public class LROsDeleteAsyncRetrycanceledHeaders { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/canceled/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/canceled/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsDeleteAsyncRetrycanceledHeaders object itself. + */ + public LROsDeleteAsyncRetrycanceledHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncRetrycanceledHeaders object itself. + */ + public LROsDeleteAsyncRetrycanceledHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteAsyncRetrycanceledHeaders object itself. + */ + public LROsDeleteAsyncRetrycanceledHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteNoHeaderInRetryHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteNoHeaderInRetryHeaders.java new file mode 100644 index 0000000000..6e91a79cad --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteNoHeaderInRetryHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteNoHeaderInRetry operation. + */ +public class LROsDeleteNoHeaderInRetryHeaders { + /** + * Location to poll for result status: will be set to + * /lro/put/noheader/202/204/operationresults. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteNoHeaderInRetryHeaders object itself. + */ + public LROsDeleteNoHeaderInRetryHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202Accepted200SucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202Accepted200SucceededHeaders.java new file mode 100644 index 0000000000..f72291acb0 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202Accepted200SucceededHeaders.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteProvisioning202Accepted200Succeeded operation. + */ +public class LROsDeleteProvisioning202Accepted200SucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/delete/provisioning/202/accepted/200/succeeded. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteProvisioning202Accepted200SucceededHeaders object itself. + */ + public LROsDeleteProvisioning202Accepted200SucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteProvisioning202Accepted200SucceededHeaders object itself. + */ + public LROsDeleteProvisioning202Accepted200SucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202DeletingFailed200Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202DeletingFailed200Headers.java new file mode 100644 index 0000000000..bac22b1dce --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202DeletingFailed200Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteProvisioning202DeletingFailed200 operation. + */ +public class LROsDeleteProvisioning202DeletingFailed200Headers { + /** + * Location to poll for result status: will be set to + * /lro/delete/provisioning/202/deleting/200/failed. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteProvisioning202DeletingFailed200Headers object itself. + */ + public LROsDeleteProvisioning202DeletingFailed200Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteProvisioning202DeletingFailed200Headers object itself. + */ + public LROsDeleteProvisioning202DeletingFailed200Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202Deletingcanceled200Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202Deletingcanceled200Headers.java new file mode 100644 index 0000000000..97abe3169c --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsDeleteProvisioning202Deletingcanceled200Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteProvisioning202Deletingcanceled200 operation. + */ +public class LROsDeleteProvisioning202Deletingcanceled200Headers { + /** + * Location to poll for result status: will be set to + * /lro/delete/provisioning/202/deleting/200/canceled. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteProvisioning202Deletingcanceled200Headers object itself. + */ + public LROsDeleteProvisioning202Deletingcanceled200Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteProvisioning202Deletingcanceled200Headers object itself. + */ + public LROsDeleteProvisioning202Deletingcanceled200Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPost202NoRetry204Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROsPost202NoRetry204Headers.java new file mode 100644 index 0000000000..a9279588f0 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPost202NoRetry204Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202NoRetry204 operation. + */ +public class LROsPost202NoRetry204Headers { + /** + * Location to poll for result status: will be set to + * /lro/post/202/noretry/204. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPost202NoRetry204Headers object itself. + */ + public LROsPost202NoRetry204Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPost202NoRetry204Headers object itself. + */ + public LROsPost202NoRetry204Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPost202Retry200Headers.java b/test/azure/src/main/java/fixtures/lro/models/LROsPost202Retry200Headers.java new file mode 100644 index 0000000000..a7084d7373 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPost202Retry200Headers.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202Retry200 operation. + */ +public class LROsPost202Retry200Headers { + /** + * Location to poll for result status: will be set to + * /lro/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPost202Retry200Headers object itself. + */ + public LROsPost202Retry200Headers withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPost202Retry200Headers object itself. + */ + public LROsPost202Retry200Headers withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncNoRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncNoRetrySucceededHeaders.java new file mode 100644 index 0000000000..3e68af1796 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncNoRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncNoRetrySucceeded operation. + */ +public class LROsPostAsyncNoRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPostAsyncNoRetrySucceededHeaders object itself. + */ + public LROsPostAsyncNoRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPostAsyncNoRetrySucceededHeaders object itself. + */ + public LROsPostAsyncNoRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPostAsyncNoRetrySucceededHeaders object itself. + */ + public LROsPostAsyncNoRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetryFailedHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetryFailedHeaders.java new file mode 100644 index 0000000000..2abb9f7de3 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetryFailedHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRetryFailed operation. + */ +public class LROsPostAsyncRetryFailedHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPostAsyncRetryFailedHeaders object itself. + */ + public LROsPostAsyncRetryFailedHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPostAsyncRetryFailedHeaders object itself. + */ + public LROsPostAsyncRetryFailedHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPostAsyncRetryFailedHeaders object itself. + */ + public LROsPostAsyncRetryFailedHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetrySucceededHeaders.java new file mode 100644 index 0000000000..0b98246e9e --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRetrySucceeded operation. + */ +public class LROsPostAsyncRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPostAsyncRetrySucceededHeaders object itself. + */ + public LROsPostAsyncRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPostAsyncRetrySucceededHeaders object itself. + */ + public LROsPostAsyncRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPostAsyncRetrySucceededHeaders object itself. + */ + public LROsPostAsyncRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetrycanceledHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetrycanceledHeaders.java new file mode 100644 index 0000000000..6f9980b611 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPostAsyncRetrycanceledHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRetrycanceled operation. + */ +public class LROsPostAsyncRetrycanceledHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/canceled/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/canceled/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPostAsyncRetrycanceledHeaders object itself. + */ + public LROsPostAsyncRetrycanceledHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPostAsyncRetrycanceledHeaders object itself. + */ + public LROsPostAsyncRetrycanceledHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPostAsyncRetrycanceledHeaders object itself. + */ + public LROsPostAsyncRetrycanceledHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoHeaderInRetryHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoHeaderInRetryHeaders.java new file mode 100644 index 0000000000..4ebca3fca1 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoHeaderInRetryHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncNoHeaderInRetry operation. + */ +public class LROsPutAsyncNoHeaderInRetryHeaders { + /** + * The azureAsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncNoHeaderInRetryHeaders object itself. + */ + public LROsPutAsyncNoHeaderInRetryHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoRetrySucceededHeaders.java new file mode 100644 index 0000000000..7521606c30 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoRetrySucceededHeaders.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncNoRetrySucceeded operation. + */ +public class LROsPutAsyncNoRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/noretry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/noretry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncNoRetrySucceededHeaders object itself. + */ + public LROsPutAsyncNoRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutAsyncNoRetrySucceededHeaders object itself. + */ + public LROsPutAsyncNoRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoRetrycanceledHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoRetrycanceledHeaders.java new file mode 100644 index 0000000000..9c8b2f6d39 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncNoRetrycanceledHeaders.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncNoRetrycanceled operation. + */ +public class LROsPutAsyncNoRetrycanceledHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/noretry/canceled/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/noretry/canceled/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncNoRetrycanceledHeaders object itself. + */ + public LROsPutAsyncNoRetrycanceledHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutAsyncNoRetrycanceledHeaders object itself. + */ + public LROsPutAsyncNoRetrycanceledHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncRetryFailedHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncRetryFailedHeaders.java new file mode 100644 index 0000000000..296acac3b6 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncRetryFailedHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRetryFailed operation. + */ +public class LROsPutAsyncRetryFailedHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncRetryFailedHeaders object itself. + */ + public LROsPutAsyncRetryFailedHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutAsyncRetryFailedHeaders object itself. + */ + public LROsPutAsyncRetryFailedHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPutAsyncRetryFailedHeaders object itself. + */ + public LROsPutAsyncRetryFailedHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncRetrySucceededHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncRetrySucceededHeaders.java new file mode 100644 index 0000000000..c46927462e --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPutAsyncRetrySucceededHeaders.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRetrySucceeded operation. + */ +public class LROsPutAsyncRetrySucceededHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncRetrySucceededHeaders object itself. + */ + public LROsPutAsyncRetrySucceededHeaders withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutAsyncRetrySucceededHeaders object itself. + */ + public LROsPutAsyncRetrySucceededHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPutAsyncRetrySucceededHeaders object itself. + */ + public LROsPutAsyncRetrySucceededHeaders withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/LROsPutNoHeaderInRetryHeaders.java b/test/azure/src/main/java/fixtures/lro/models/LROsPutNoHeaderInRetryHeaders.java new file mode 100644 index 0000000000..b45345d3b7 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/LROsPutNoHeaderInRetryHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putNoHeaderInRetry operation. + */ +public class LROsPutNoHeaderInRetryHeaders { + /** + * Location to poll for result status: will be set to + * /lro/putasync/noheader/202/200/operationResults. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutNoHeaderInRetryHeaders object itself. + */ + public LROsPutNoHeaderInRetryHeaders withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/OperationResult.java b/test/azure/src/main/java/fixtures/lro/models/OperationResult.java new file mode 100644 index 0000000000..53147414f0 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/OperationResult.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationResult model. + */ +public class OperationResult { + /** + * The status of the request. Possible values include: 'Succeeded', + * 'Failed', 'canceled', 'Accepted', 'Creating', 'Created', 'Updating', + * 'Updated', 'Deleting', 'Deleted', 'OK'. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The error property. + */ + @JsonProperty(value = "error") + private OperationResultError error; + + /** + * Get the status value. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the OperationResult object itself. + */ + public OperationResult withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the error value. + * + * @return the error value + */ + public OperationResultError error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the OperationResult object itself. + */ + public OperationResult withError(OperationResultError error) { + this.error = error; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/OperationResultError.java b/test/azure/src/main/java/fixtures/lro/models/OperationResultError.java new file mode 100644 index 0000000000..b4c5389fde --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/OperationResultError.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationResultError model. + */ +public class OperationResultError { + /** + * The error code for an operation failure. + */ + @JsonProperty(value = "code") + private Integer code; + + /** + * The detailed arror message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public Integer code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the OperationResultError object itself. + */ + public OperationResultError withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the OperationResultError object itself. + */ + public OperationResultError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/Product.java b/test/azure/src/main/java/fixtures/lro/models/Product.java new file mode 100644 index 0000000000..3d9afb514b --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/Product.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The Product model. + */ +@JsonFlatten +public class Product extends Resource { + /** + * The provisioningState property. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Possible values include: 'Succeeded', 'Failed', 'canceled', 'Accepted', + * 'Creating', 'Created', 'Updating', 'Updated', 'Deleting', 'Deleted', + * 'OK'. + */ + @JsonProperty(value = "properties.provisioningStateValues", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStateValues; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the Product object itself. + */ + public Product withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the provisioningStateValues value. + * + * @return the provisioningStateValues value + */ + public String provisioningStateValues() { + return this.provisioningStateValues; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/Sku.java b/test/azure/src/main/java/fixtures/lro/models/Sku.java new file mode 100644 index 0000000000..ade27afea3 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/Sku.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Sku model. + */ +public class Sku { + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the Sku object itself. + */ + public Sku withId(String id) { + this.id = id; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/SubProduct.java b/test/azure/src/main/java/fixtures/lro/models/SubProduct.java new file mode 100644 index 0000000000..3e9fbdc383 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/SubProduct.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * The SubProduct model. + */ +@JsonFlatten +public class SubProduct extends SubResource { + /** + * The provisioningState property. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Possible values include: 'Succeeded', 'Failed', 'canceled', 'Accepted', + * 'Creating', 'Created', 'Updating', 'Updated', 'Deleting', 'Deleted', + * 'OK'. + */ + @JsonProperty(value = "properties.provisioningStateValues", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStateValues; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the SubProduct object itself. + */ + public SubProduct withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the provisioningStateValues value. + * + * @return the provisioningStateValues value + */ + public String provisioningStateValues() { + return this.provisioningStateValues; + } + +} diff --git a/test/azure/src/main/java/fixtures/lro/models/package-info.java b/test/azure/src/main/java/fixtures/lro/models/package-info.java new file mode 100644 index 0000000000..9ae664df14 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestLongRunningOperationTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.lro.models; diff --git a/test/azure/src/main/java/fixtures/lro/package-info.java b/test/azure/src/main/java/fixtures/lro/package-info.java new file mode 100644 index 0000000000..4d8c8286a0 --- /dev/null +++ b/test/azure/src/main/java/fixtures/lro/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestLongRunningOperationTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.lro; diff --git a/test/azure/src/main/java/fixtures/paging/AutoRestPagingTestService.java b/test/azure/src/main/java/fixtures/paging/AutoRestPagingTestService.java new file mode 100644 index 0000000000..945856dbd5 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/AutoRestPagingTestService.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestPagingTestService class. + */ +public interface AutoRestPagingTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + AutoRestPagingTestService withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + AutoRestPagingTestService withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + AutoRestPagingTestService withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Pagings object to access its operations. + * @return the Pagings object. + */ + Pagings pagings(); + +} diff --git a/test/azure/src/main/java/fixtures/paging/Pagings.java b/test/azure/src/main/java/fixtures/paging/Pagings.java new file mode 100644 index 0000000000..f0f07e30ec --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/Pagings.java @@ -0,0 +1,1154 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.paging.models.CustomParameterGroup; +import fixtures.paging.models.PagingGetMultiplePagesOptions; +import fixtures.paging.models.PagingGetMultiplePagesWithOffsetNextOptions; +import fixtures.paging.models.PagingGetMultiplePagesWithOffsetOptions; +import fixtures.paging.models.PagingGetOdataMultiplePagesOptions; +import fixtures.paging.models.Product; +import java.io.IOException; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Pagings. + */ +public interface Pagings { + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getSinglePages(); + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSinglePagesAsync(final ListOperationCallback serviceCallback); + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getSinglePagesAsync(); + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getSinglePagesWithServiceResponseAsync(); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePages(); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesAsync(final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesAsync(); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesWithServiceResponseAsync(); + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePages(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesAsync(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesAsync(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesWithServiceResponseAsync(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getOdataMultiplePages(); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getOdataMultiplePagesAsync(final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getOdataMultiplePagesAsync(); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getOdataMultiplePagesWithServiceResponseAsync(); + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getOdataMultiplePages(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getOdataMultiplePagesWithServiceResponseAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesWithOffsetWithServiceResponseAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions); + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesWithOffsetWithServiceResponseAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId); + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesRetryFirst(); + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesRetryFirstAsync(final ListOperationCallback serviceCallback); + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesRetryFirstAsync(); + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesRetryFirstWithServiceResponseAsync(); + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesRetrySecond(); + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesRetrySecondAsync(final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesRetrySecondAsync(); + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesRetrySecondWithServiceResponseAsync(); + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getSinglePagesFailure(); + + /** + * A paging operation that receives a 400 on the first call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSinglePagesFailureAsync(final ListOperationCallback serviceCallback); + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getSinglePagesFailureAsync(); + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getSinglePagesFailureWithServiceResponseAsync(); + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesFailure(); + + /** + * A paging operation that receives a 400 on the second call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesFailureAsync(final ListOperationCallback serviceCallback); + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesFailureAsync(); + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesFailureWithServiceResponseAsync(); + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesFailureUri(); + + /** + * A paging operation that receives an invalid nextLink. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesFailureUriAsync(final ListOperationCallback serviceCallback); + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesFailureUriAsync(); + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesFailureUriWithServiceResponseAsync(); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesFragmentNextLink(final String tenant, final String apiVersion); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesFragmentNextLinkAsync(final String tenant, final String apiVersion, final ListOperationCallback serviceCallback); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesFragmentNextLinkAsync(final String tenant, final String apiVersion); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesFragmentNextLinkWithServiceResponseAsync(final String tenant, final String apiVersion); + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesFragmentWithGroupingNextLink(final CustomParameterGroup customParameterGroup); + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesFragmentWithGroupingNextLinkAsync(final CustomParameterGroup customParameterGroup, final ListOperationCallback serviceCallback); + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesFragmentWithGroupingNextLinkAsync(final CustomParameterGroup customParameterGroup); + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesFragmentWithGroupingNextLinkWithServiceResponseAsync(final CustomParameterGroup customParameterGroup); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList nextFragment(final String tenant, final String nextLink, final String apiVersion); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> nextFragmentAsync(final String tenant, final String nextLink, final String apiVersion, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> nextFragmentAsync(final String tenant, final String nextLink, final String apiVersion); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> nextFragmentWithServiceResponseAsync(final String tenant, final String nextLink, final String apiVersion); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList nextFragmentWithGrouping(final String nextLink, final CustomParameterGroup customParameterGroup); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> nextFragmentWithGroupingAsync(final String nextLink, final CustomParameterGroup customParameterGroup, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> nextFragmentWithGroupingAsync(final String nextLink, final CustomParameterGroup customParameterGroup); + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> nextFragmentWithGroupingWithServiceResponseAsync(final String nextLink, final CustomParameterGroup customParameterGroup); + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getSinglePagesNext(final String nextPageLink); + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSinglePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getSinglePagesNextAsync(final String nextPageLink); + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getSinglePagesNextWithServiceResponseAsync(final String nextPageLink); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesNext(final String nextPageLink); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesNextAsync(final String nextPageLink); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesNextWithServiceResponseAsync(final String nextPageLink); + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesNext(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getOdataMultiplePagesNext(final String nextPageLink); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getOdataMultiplePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getOdataMultiplePagesNextAsync(final String nextPageLink); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getOdataMultiplePagesNextWithServiceResponseAsync(final String nextPageLink); + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getOdataMultiplePagesNext(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getOdataMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getOdataMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getOdataMultiplePagesNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesWithOffsetNext(final String nextPageLink); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesWithOffsetNextAsync(final String nextPageLink); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesWithOffsetNextWithServiceResponseAsync(final String nextPageLink); + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesWithOffsetNext(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions); + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesWithOffsetNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions); + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesRetryFirstNext(final String nextPageLink); + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesRetryFirstNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesRetryFirstNextAsync(final String nextPageLink); + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesRetryFirstNextWithServiceResponseAsync(final String nextPageLink); + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesRetrySecondNext(final String nextPageLink); + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesRetrySecondNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesRetrySecondNextAsync(final String nextPageLink); + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesRetrySecondNextWithServiceResponseAsync(final String nextPageLink); + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getSinglePagesFailureNext(final String nextPageLink); + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getSinglePagesFailureNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getSinglePagesFailureNextAsync(final String nextPageLink); + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getSinglePagesFailureNextWithServiceResponseAsync(final String nextPageLink); + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesFailureNext(final String nextPageLink); + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesFailureNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesFailureNextAsync(final String nextPageLink); + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesFailureNextWithServiceResponseAsync(final String nextPageLink); + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + PagedList getMultiplePagesFailureUriNext(final String nextPageLink); + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getMultiplePagesFailureUriNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback); + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable> getMultiplePagesFailureUriNextAsync(final String nextPageLink); + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + Observable>> getMultiplePagesFailureUriNextWithServiceResponseAsync(final String nextPageLink); + +} diff --git a/test/azure/src/main/java/fixtures/paging/implementation/AutoRestPagingTestServiceImpl.java b/test/azure/src/main/java/fixtures/paging/implementation/AutoRestPagingTestServiceImpl.java new file mode 100644 index 0000000000..95cbac0040 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/implementation/AutoRestPagingTestServiceImpl.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import fixtures.paging.AutoRestPagingTestService; +import fixtures.paging.Pagings; + +/** + * Initializes a new instance of the AutoRestPagingTestServiceImpl class. + */ +public class AutoRestPagingTestServiceImpl extends AzureServiceClient implements AutoRestPagingTestService { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestPagingTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestPagingTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestPagingTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Pagings object to access its operations. + */ + private Pagings pagings; + + /** + * Gets the Pagings object to access its operations. + * @return the Pagings object. + */ + public Pagings pagings() { + return this.pagings; + } + + /** + * Initializes an instance of AutoRestPagingTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestPagingTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestPagingTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestPagingTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestPagingTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestPagingTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.pagings = new PagingsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestPagingTestService", "1.0.0"); + } +} diff --git a/test/azure/src/main/java/fixtures/paging/implementation/PagingsImpl.java b/test/azure/src/main/java/fixtures/paging/implementation/PagingsImpl.java new file mode 100644 index 0000000000..b9e20fe4a3 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/implementation/PagingsImpl.java @@ -0,0 +1,3304 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import retrofit2.Retrofit; +import fixtures.paging.Pagings; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.paging.models.CustomParameterGroup; +import fixtures.paging.models.PageImpl; +import fixtures.paging.models.PageImpl1; +import fixtures.paging.models.PagingGetMultiplePagesOptions; +import fixtures.paging.models.PagingGetMultiplePagesWithOffsetNextOptions; +import fixtures.paging.models.PagingGetMultiplePagesWithOffsetOptions; +import fixtures.paging.models.PagingGetOdataMultiplePagesOptions; +import fixtures.paging.models.Product; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Pagings. + */ +public class PagingsImpl implements Pagings { + /** The Retrofit service to perform REST calls. */ + private PagingsService service; + /** The service client containing this operation class. */ + private AutoRestPagingTestServiceImpl client; + + /** + * Initializes an instance of PagingsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PagingsImpl(Retrofit retrofit, AutoRestPagingTestServiceImpl client) { + this.service = retrofit.create(PagingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Pagings to be + * used by Retrofit to perform actually REST calls. + */ + interface PagingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePages" }) + @GET("paging/single") + Observable> getSinglePages(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePages" }) + @GET("paging/multiple") + Observable> getMultiplePages(@Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getOdataMultiplePages" }) + @GET("paging/multiple/odata") + Observable> getOdataMultiplePages(@Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesWithOffset" }) + @GET("paging/multiple/withpath/{offset}") + Observable> getMultiplePagesWithOffset(@Path("offset") int offset, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetryFirst" }) + @GET("paging/multiple/retryfirst") + Observable> getMultiplePagesRetryFirst(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetrySecond" }) + @GET("paging/multiple/retrysecond") + Observable> getMultiplePagesRetrySecond(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesFailure" }) + @GET("paging/single/failure") + Observable> getSinglePagesFailure(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailure" }) + @GET("paging/multiple/failure") + Observable> getMultiplePagesFailure(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureUri" }) + @GET("paging/multiple/failureuri") + Observable> getMultiplePagesFailureUri(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFragmentNextLink" }) + @GET("paging/multiple/fragment/{tenant}") + Observable> getMultiplePagesFragmentNextLink(@Path("tenant") String tenant, @Query("api_version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFragmentWithGroupingNextLink" }) + @GET("paging/multiple/fragmentwithgrouping/{tenant}") + Observable> getMultiplePagesFragmentWithGroupingNextLink(@Path("tenant") String tenant, @Header("accept-language") String acceptLanguage, @Query("api_version") String apiVersion, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings nextFragment" }) + @GET + Observable> nextFragment(@Url String nextUrl, @Query("api_version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings nextFragmentWithGrouping" }) + @GET + Observable> nextFragmentWithGrouping(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Query("api_version") String apiVersion, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesNext" }) + @GET + Observable> getSinglePagesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesNext" }) + @GET + Observable> getMultiplePagesNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getOdataMultiplePagesNext" }) + @GET + Observable> getOdataMultiplePagesNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesWithOffsetNext" }) + @GET + Observable> getMultiplePagesWithOffsetNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetryFirstNext" }) + @GET + Observable> getMultiplePagesRetryFirstNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetrySecondNext" }) + @GET + Observable> getMultiplePagesRetrySecondNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesFailureNext" }) + @GET + Observable> getSinglePagesFailureNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureNext" }) + @GET + Observable> getMultiplePagesFailureNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureUriNext" }) + @GET + Observable> getMultiplePagesFailureUriNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getSinglePages() { + ServiceResponse> response = getSinglePagesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSinglePagesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePagesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getSinglePagesAsync() { + return getSinglePagesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getSinglePagesWithServiceResponseAsync() { + return getSinglePagesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSinglePagesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePagesSinglePageAsync() { + return service.getSinglePages(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSinglePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSinglePagesDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePages() { + ServiceResponse> response = getMultiplePagesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesAsync() { + return getMultiplePagesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesWithServiceResponseAsync() { + return getMultiplePagesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesSinglePageAsync() { + final String clientRequestId = null; + final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions = null; + Integer maxresults = null; + Integer timeout = null; + return service.getMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePages(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions) { + ServiceResponse> response = getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesAsync(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesAsync(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions) { + return getMultiplePagesWithServiceResponseAsync(clientRequestId, pagingGetMultiplePagesOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesWithServiceResponseAsync(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions) { + return getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesSinglePageAsync(final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions) { + Validator.validate(pagingGetMultiplePagesOptions); + Integer maxresults = null; + if (pagingGetMultiplePagesOptions != null) { + maxresults = pagingGetMultiplePagesOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetMultiplePagesOptions != null) { + timeout = pagingGetMultiplePagesOptions.timeout(); + } + return service.getMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getOdataMultiplePages() { + ServiceResponse> response = getOdataMultiplePagesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getOdataMultiplePagesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOdataMultiplePagesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getOdataMultiplePagesAsync() { + return getOdataMultiplePagesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getOdataMultiplePagesWithServiceResponseAsync() { + return getOdataMultiplePagesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOdataMultiplePagesSinglePageAsync() { + final String clientRequestId = null; + final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions = null; + Integer maxresults = null; + Integer timeout = null; + return service.getOdataMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOdataMultiplePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getOdataMultiplePages(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions) { + ServiceResponse> response = getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions) { + return getOdataMultiplePagesWithServiceResponseAsync(clientRequestId, pagingGetOdataMultiplePagesOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getOdataMultiplePagesWithServiceResponseAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions) { + return getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOdataMultiplePagesSinglePageAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions) { + Validator.validate(pagingGetOdataMultiplePagesOptions); + Integer maxresults = null; + if (pagingGetOdataMultiplePagesOptions != null) { + maxresults = pagingGetOdataMultiplePagesOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetOdataMultiplePagesOptions != null) { + timeout = pagingGetOdataMultiplePagesOptions.timeout(); + } + return service.getOdataMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOdataMultiplePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getOdataMultiplePagesDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions) { + ServiceResponse> response = getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions) { + return getMultiplePagesWithOffsetWithServiceResponseAsync(pagingGetMultiplePagesWithOffsetOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesWithOffsetWithServiceResponseAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions) { + return getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesWithOffsetSinglePageAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions) { + if (pagingGetMultiplePagesWithOffsetOptions == null) { + throw new IllegalArgumentException("Parameter pagingGetMultiplePagesWithOffsetOptions is required and cannot be null."); + } + Validator.validate(pagingGetMultiplePagesWithOffsetOptions); + final String clientRequestId = null; + Integer maxresults = pagingGetMultiplePagesWithOffsetOptions.maxresults(); + int offset = pagingGetMultiplePagesWithOffsetOptions.offset(); + Integer timeout = pagingGetMultiplePagesWithOffsetOptions.timeout(); + return service.getMultiplePagesWithOffset(offset, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesWithOffsetDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) { + ServiceResponse> response = getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) { + return getMultiplePagesWithOffsetWithServiceResponseAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesWithOffsetWithServiceResponseAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) { + return getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptions(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + ServiceResponse> * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + ServiceResponse> * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesWithOffsetSinglePageAsync(final PagingGetMultiplePagesWithOffsetOptions pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) { + if (pagingGetMultiplePagesWithOffsetOptions == null) { + throw new IllegalArgumentException("Parameter pagingGetMultiplePagesWithOffsetOptions is required and cannot be null."); + } + Validator.validate(pagingGetMultiplePagesWithOffsetOptions); + Integer maxresults = pagingGetMultiplePagesWithOffsetOptions.maxresults(); + int offset = pagingGetMultiplePagesWithOffsetOptions.offset(); + Integer timeout = pagingGetMultiplePagesWithOffsetOptions.timeout(); + return service.getMultiplePagesWithOffset(offset, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesWithOffsetDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesWithOffsetDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesRetryFirst() { + ServiceResponse> response = getMultiplePagesRetryFirstSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesRetryFirstAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesRetryFirstSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesRetryFirstAsync() { + return getMultiplePagesRetryFirstWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesRetryFirstWithServiceResponseAsync() { + return getMultiplePagesRetryFirstSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesRetryFirstSinglePageAsync() { + return service.getMultiplePagesRetryFirst(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesRetryFirstDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesRetryFirstDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesRetrySecond() { + ServiceResponse> response = getMultiplePagesRetrySecondSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesRetrySecondAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesRetrySecondSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesRetrySecondAsync() { + return getMultiplePagesRetrySecondWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesRetrySecondWithServiceResponseAsync() { + return getMultiplePagesRetrySecondSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesRetrySecondSinglePageAsync() { + return service.getMultiplePagesRetrySecond(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesRetrySecondDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesRetrySecondDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getSinglePagesFailure() { + ServiceResponse> response = getSinglePagesFailureSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSinglePagesFailureAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePagesFailureSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getSinglePagesFailureAsync() { + return getSinglePagesFailureWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getSinglePagesFailureWithServiceResponseAsync() { + return getSinglePagesFailureSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePagesFailureSinglePageAsync() { + return service.getSinglePagesFailure(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSinglePagesFailureDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSinglePagesFailureDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesFailure() { + ServiceResponse> response = getMultiplePagesFailureSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFailureAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFailureSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesFailureAsync() { + return getMultiplePagesFailureWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesFailureWithServiceResponseAsync() { + return getMultiplePagesFailureSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFailureSinglePageAsync() { + return service.getMultiplePagesFailure(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFailureDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFailureDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesFailureUri() { + ServiceResponse> response = getMultiplePagesFailureUriSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFailureUriAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFailureUriSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesFailureUriAsync() { + return getMultiplePagesFailureUriWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesFailureUriWithServiceResponseAsync() { + return getMultiplePagesFailureUriSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFailureUriSinglePageAsync() { + return service.getMultiplePagesFailureUri(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFailureUriDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFailureUriDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesFragmentNextLink(final String tenant, final String apiVersion) { + ServiceResponse> response = getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextLink) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFragmentNextLinkAsync(final String tenant, final String apiVersion, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion), + new Func1>>>() { + @Override + public Observable>> call(String nextLink) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion); + } + }, + serviceCallback); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesFragmentNextLinkAsync(final String tenant, final String apiVersion) { + return getMultiplePagesFragmentNextLinkWithServiceResponseAsync(tenant, apiVersion) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesFragmentNextLinkWithServiceResponseAsync(final String tenant, final String apiVersion) { + return getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextLink = page.body().nextPageLink(); + if (nextLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion)); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + ServiceResponse> * @param tenant Sets the tenant to use. + ServiceResponse> * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFragmentNextLinkSinglePageAsync(final String tenant, final String apiVersion) { + if (tenant == null) { + throw new IllegalArgumentException("Parameter tenant is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.getMultiplePagesFragmentNextLink(tenant, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFragmentNextLinkDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFragmentNextLinkDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesFragmentWithGroupingNextLink(final CustomParameterGroup customParameterGroup) { + ServiceResponse> response = getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextLink) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFragmentWithGroupingNextLinkAsync(final CustomParameterGroup customParameterGroup, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup), + new Func1>>>() { + @Override + public Observable>> call(String nextLink) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup); + } + }, + serviceCallback); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesFragmentWithGroupingNextLinkAsync(final CustomParameterGroup customParameterGroup) { + return getMultiplePagesFragmentWithGroupingNextLinkWithServiceResponseAsync(customParameterGroup) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesFragmentWithGroupingNextLinkWithServiceResponseAsync(final CustomParameterGroup customParameterGroup) { + return getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextLink = page.body().nextPageLink(); + if (nextLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup)); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + ServiceResponse> * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(final CustomParameterGroup customParameterGroup) { + if (customParameterGroup == null) { + throw new IllegalArgumentException("Parameter customParameterGroup is required and cannot be null."); + } + Validator.validate(customParameterGroup); + String apiVersion = customParameterGroup.apiVersion(); + String tenant = customParameterGroup.tenant(); + return service.getMultiplePagesFragmentWithGroupingNextLink(tenant, this.client.acceptLanguage(), apiVersion, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFragmentWithGroupingNextLinkDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFragmentWithGroupingNextLinkDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList nextFragment(final String tenant, final String nextLink, final String apiVersion) { + ServiceResponse> response = nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextLink) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> nextFragmentAsync(final String tenant, final String nextLink, final String apiVersion, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + nextFragmentSinglePageAsync(tenant, nextLink, apiVersion), + new Func1>>>() { + @Override + public Observable>> call(String nextLink) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion); + } + }, + serviceCallback); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> nextFragmentAsync(final String tenant, final String nextLink, final String apiVersion) { + return nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> nextFragmentWithServiceResponseAsync(final String tenant, final String nextLink, final String apiVersion) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextLink = page.body().nextPageLink(); + if (nextLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion)); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + ServiceResponse> * @param tenant Sets the tenant to use. + ServiceResponse> * @param nextLink Next link for list operation. + ServiceResponse> * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> nextFragmentSinglePageAsync(final String tenant, final String nextLink, final String apiVersion) { + if (tenant == null) { + throw new IllegalArgumentException("Parameter tenant is required and cannot be null."); + } + if (nextLink == null) { + throw new IllegalArgumentException("Parameter nextLink is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + String nextUrl = String.format("paging/multiple/fragment/%s/%s", tenant, nextLink); + return service.nextFragment(nextUrl, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = nextFragmentDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> nextFragmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList nextFragmentWithGrouping(final String nextLink, final CustomParameterGroup customParameterGroup) { + ServiceResponse> response = nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextLink) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> nextFragmentWithGroupingAsync(final String nextLink, final CustomParameterGroup customParameterGroup, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup), + new Func1>>>() { + @Override + public Observable>> call(String nextLink) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup); + } + }, + serviceCallback); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> nextFragmentWithGroupingAsync(final String nextLink, final CustomParameterGroup customParameterGroup) { + return nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> nextFragmentWithGroupingWithServiceResponseAsync(final String nextLink, final CustomParameterGroup customParameterGroup) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextLink = page.body().nextPageLink(); + if (nextLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup)); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + ServiceResponse> * @param nextLink Next link for list operation. + ServiceResponse> * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> nextFragmentWithGroupingSinglePageAsync(final String nextLink, final CustomParameterGroup customParameterGroup) { + if (nextLink == null) { + throw new IllegalArgumentException("Parameter nextLink is required and cannot be null."); + } + if (customParameterGroup == null) { + throw new IllegalArgumentException("Parameter customParameterGroup is required and cannot be null."); + } + Validator.validate(customParameterGroup); + String apiVersion = customParameterGroup.apiVersion(); + String tenant = customParameterGroup.tenant(); + String nextUrl = String.format("paging/multiple/fragmentwithgrouping/%s/%s", tenant, nextLink); + return service.nextFragmentWithGrouping(nextUrl, this.client.acceptLanguage(), apiVersion, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = nextFragmentWithGroupingDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> nextFragmentWithGroupingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getSinglePagesNext(final String nextPageLink) { + ServiceResponse> response = getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSinglePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePagesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getSinglePagesNextAsync(final String nextPageLink) { + return getSinglePagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getSinglePagesNextWithServiceResponseAsync(final String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSinglePagesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePagesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSinglePagesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSinglePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSinglePagesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesNextAsync(final String nextPageLink) { + return getMultiplePagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final String clientRequestId = null; + final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions = null; + Integer maxresults = null; + Integer timeout = null; + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesNext(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions) { + ServiceResponse> response = getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions) { + return getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptions pagingGetMultiplePagesOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(pagingGetMultiplePagesOptions); + Integer maxresults = null; + if (pagingGetMultiplePagesOptions != null) { + maxresults = pagingGetMultiplePagesOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetMultiplePagesOptions != null) { + timeout = pagingGetMultiplePagesOptions.timeout(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getOdataMultiplePagesNext(final String nextPageLink) { + ServiceResponse> response = getOdataMultiplePagesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getOdataMultiplePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOdataMultiplePagesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getOdataMultiplePagesNextAsync(final String nextPageLink) { + return getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getOdataMultiplePagesNextWithServiceResponseAsync(final String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOdataMultiplePagesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final String clientRequestId = null; + final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions = null; + Integer maxresults = null; + Integer timeout = null; + String nextUrl = String.format("%s", nextPageLink); + return service.getOdataMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOdataMultiplePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getOdataMultiplePagesNext(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions) { + ServiceResponse> response = getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getOdataMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getOdataMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions) { + return getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getOdataMultiplePagesNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOdataMultiplePagesNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptions pagingGetOdataMultiplePagesOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(pagingGetOdataMultiplePagesOptions); + Integer maxresults = null; + if (pagingGetOdataMultiplePagesOptions != null) { + maxresults = pagingGetOdataMultiplePagesOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetOdataMultiplePagesOptions != null) { + timeout = pagingGetOdataMultiplePagesOptions.timeout(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getOdataMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOdataMultiplePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getOdataMultiplePagesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesWithOffsetNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesWithOffsetNextAsync(final String nextPageLink) { + return getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesWithOffsetNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesWithOffsetNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final String clientRequestId = null; + final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions = null; + Integer maxresults = null; + Integer timeout = null; + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesWithOffsetNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesWithOffsetNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesWithOffsetNext(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions) { + ServiceResponse> response = getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions) { + return getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesWithOffsetNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesWithOffsetNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptions pagingGetMultiplePagesWithOffsetNextOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(pagingGetMultiplePagesWithOffsetNextOptions); + Integer maxresults = null; + if (pagingGetMultiplePagesWithOffsetNextOptions != null) { + maxresults = pagingGetMultiplePagesWithOffsetNextOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetMultiplePagesWithOffsetNextOptions != null) { + timeout = pagingGetMultiplePagesWithOffsetNextOptions.timeout(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesWithOffsetNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesWithOffsetNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesWithOffsetNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesRetryFirstNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesRetryFirstNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesRetryFirstNextAsync(final String nextPageLink) { + return getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesRetryFirstNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesRetryFirstNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesRetryFirstNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesRetryFirstNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesRetryFirstNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesRetrySecondNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesRetrySecondNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesRetrySecondNextAsync(final String nextPageLink) { + return getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesRetrySecondNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesRetrySecondNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesRetrySecondNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesRetrySecondNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesRetrySecondNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getSinglePagesFailureNext(final String nextPageLink) { + ServiceResponse> response = getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSinglePagesFailureNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePagesFailureNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getSinglePagesFailureNextAsync(final String nextPageLink) { + return getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getSinglePagesFailureNextWithServiceResponseAsync(final String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives a 400 on the first call. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePagesFailureNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSinglePagesFailureNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSinglePagesFailureNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSinglePagesFailureNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesFailureNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFailureNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFailureNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesFailureNextAsync(final String nextPageLink) { + return getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesFailureNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives a 400 on the second call. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFailureNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesFailureNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFailureNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFailureNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<Product> object if successful. + */ + public PagedList getMultiplePagesFailureUriNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFailureUriNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable> getMultiplePagesFailureUriNextAsync(final String nextPageLink) { + return getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<Product> object + */ + public Observable>> getMultiplePagesFailureUriNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives an invalid nextLink. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<Product> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFailureUriNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesFailureUriNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFailureUriNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFailureUriNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/implementation/package-info.java b/test/azure/src/main/java/fixtures/paging/implementation/package-info.java new file mode 100644 index 0000000000..2a185d9735 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestPagingTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.paging.implementation; diff --git a/test/azure/src/main/java/fixtures/paging/models/CustomParameterGroup.java b/test/azure/src/main/java/fixtures/paging/models/CustomParameterGroup.java new file mode 100644 index 0000000000..a3ed1986ee --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/CustomParameterGroup.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for a set of operations, such as: + * Paging_getMultiplePagesFragmentWithGroupingNextLink, + * Paging_nextFragmentWithGrouping. + */ +public class CustomParameterGroup { + /** + * Sets the api version to use. + */ + @JsonProperty(value = "", required = true) + private String apiVersion; + + /** + * Sets the tenant to use. + */ + @JsonProperty(value = "", required = true) + private String tenant; + + /** + * Get the apiVersion value. + * + * @return the apiVersion value + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Set the apiVersion value. + * + * @param apiVersion the apiVersion value to set + * @return the CustomParameterGroup object itself. + */ + public CustomParameterGroup withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get the tenant value. + * + * @return the tenant value + */ + public String tenant() { + return this.tenant; + } + + /** + * Set the tenant value. + * + * @param tenant the tenant value to set + * @return the CustomParameterGroup object itself. + */ + public CustomParameterGroup withTenant(String tenant) { + this.tenant = tenant; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/models/OperationResult.java b/test/azure/src/main/java/fixtures/paging/models/OperationResult.java new file mode 100644 index 0000000000..e71f71fa13 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/OperationResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationResult model. + */ +public class OperationResult { + /** + * The status of the request. Possible values include: 'Succeeded', + * 'Failed', 'canceled', 'Accepted', 'Creating', 'Created', 'Updating', + * 'Updated', 'Deleting', 'Deleted', 'OK'. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get the status value. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the OperationResult object itself. + */ + public OperationResult withStatus(String status) { + this.status = status; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/models/PageImpl.java b/test/azure/src/main/java/fixtures/paging/models/PageImpl.java new file mode 100644 index 0000000000..f2986022f5 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/PageImpl.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("values") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/test/azure/src/main/java/fixtures/paging/models/PageImpl1.java b/test/azure/src/main/java/fixtures/paging/models/PageImpl1.java new file mode 100644 index 0000000000..ba6ad4acf7 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/PageImpl1.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("odata.nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("values") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java b/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java new file mode 100644 index 0000000000..6ce4704815 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesOptions.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for getMultiplePages operation. + */ +public class PagingGetMultiplePagesOptions { + /** + * Sets the maximum number of items to return in the response. + */ + @JsonProperty(value = "") + private Integer maxresults; + + /** + * Sets the maximum time that the server can spend processing the request, + * in seconds. The default is 30 seconds. + */ + @JsonProperty(value = "") + private Integer timeout; + + /** + * Get the maxresults value. + * + * @return the maxresults value + */ + public Integer maxresults() { + return this.maxresults; + } + + /** + * Set the maxresults value. + * + * @param maxresults the maxresults value to set + * @return the PagingGetMultiplePagesOptions object itself. + */ + public PagingGetMultiplePagesOptions withMaxresults(Integer maxresults) { + this.maxresults = maxresults; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the PagingGetMultiplePagesOptions object itself. + */ + public PagingGetMultiplePagesOptions withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetNextOptions.java b/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetNextOptions.java new file mode 100644 index 0000000000..1425eea83b --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetNextOptions.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for getMultiplePagesWithOffsetNext operation. + */ +public class PagingGetMultiplePagesWithOffsetNextOptions { + /** + * Sets the maximum number of items to return in the response. + */ + @JsonProperty(value = "") + private Integer maxresults; + + /** + * Sets the maximum time that the server can spend processing the request, + * in seconds. The default is 30 seconds. + */ + @JsonProperty(value = "") + private Integer timeout; + + /** + * Get the maxresults value. + * + * @return the maxresults value + */ + public Integer maxresults() { + return this.maxresults; + } + + /** + * Set the maxresults value. + * + * @param maxresults the maxresults value to set + * @return the PagingGetMultiplePagesWithOffsetNextOptions object itself. + */ + public PagingGetMultiplePagesWithOffsetNextOptions withMaxresults(Integer maxresults) { + this.maxresults = maxresults; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the PagingGetMultiplePagesWithOffsetNextOptions object itself. + */ + public PagingGetMultiplePagesWithOffsetNextOptions withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java b/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java new file mode 100644 index 0000000000..2d59159fa9 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/PagingGetMultiplePagesWithOffsetOptions.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for getMultiplePagesWithOffset operation. + */ +public class PagingGetMultiplePagesWithOffsetOptions { + /** + * Sets the maximum number of items to return in the response. + */ + @JsonProperty(value = "") + private Integer maxresults; + + /** + * Offset of return value. + */ + @JsonProperty(value = "", required = true) + private int offset; + + /** + * Sets the maximum time that the server can spend processing the request, + * in seconds. The default is 30 seconds. + */ + @JsonProperty(value = "") + private Integer timeout; + + /** + * Get the maxresults value. + * + * @return the maxresults value + */ + public Integer maxresults() { + return this.maxresults; + } + + /** + * Set the maxresults value. + * + * @param maxresults the maxresults value to set + * @return the PagingGetMultiplePagesWithOffsetOptions object itself. + */ + public PagingGetMultiplePagesWithOffsetOptions withMaxresults(Integer maxresults) { + this.maxresults = maxresults; + return this; + } + + /** + * Get the offset value. + * + * @return the offset value + */ + public int offset() { + return this.offset; + } + + /** + * Set the offset value. + * + * @param offset the offset value to set + * @return the PagingGetMultiplePagesWithOffsetOptions object itself. + */ + public PagingGetMultiplePagesWithOffsetOptions withOffset(int offset) { + this.offset = offset; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the PagingGetMultiplePagesWithOffsetOptions object itself. + */ + public PagingGetMultiplePagesWithOffsetOptions withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/models/PagingGetOdataMultiplePagesOptions.java b/test/azure/src/main/java/fixtures/paging/models/PagingGetOdataMultiplePagesOptions.java new file mode 100644 index 0000000000..d4d3a5c625 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/PagingGetOdataMultiplePagesOptions.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for getOdataMultiplePages operation. + */ +public class PagingGetOdataMultiplePagesOptions { + /** + * Sets the maximum number of items to return in the response. + */ + @JsonProperty(value = "") + private Integer maxresults; + + /** + * Sets the maximum time that the server can spend processing the request, + * in seconds. The default is 30 seconds. + */ + @JsonProperty(value = "") + private Integer timeout; + + /** + * Get the maxresults value. + * + * @return the maxresults value + */ + public Integer maxresults() { + return this.maxresults; + } + + /** + * Set the maxresults value. + * + * @param maxresults the maxresults value to set + * @return the PagingGetOdataMultiplePagesOptions object itself. + */ + public PagingGetOdataMultiplePagesOptions withMaxresults(Integer maxresults) { + this.maxresults = maxresults; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the PagingGetOdataMultiplePagesOptions object itself. + */ + public PagingGetOdataMultiplePagesOptions withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/models/Product.java b/test/azure/src/main/java/fixtures/paging/models/Product.java new file mode 100644 index 0000000000..6ce65ec2c5 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/Product.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Product model. + */ +public class Product { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private ProductProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public ProductProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the Product object itself. + */ + public Product withProperties(ProductProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/models/ProductProperties.java b/test/azure/src/main/java/fixtures/paging/models/ProductProperties.java new file mode 100644 index 0000000000..4dd40f590d --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/ProductProperties.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ProductProperties model. + */ +public class ProductProperties { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the ProductProperties object itself. + */ + public ProductProperties withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the ProductProperties object itself. + */ + public ProductProperties withName(String name) { + this.name = name; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/paging/models/package-info.java b/test/azure/src/main/java/fixtures/paging/models/package-info.java new file mode 100644 index 0000000000..1ce439d618 --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestPagingTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.paging.models; diff --git a/test/azure/src/main/java/fixtures/paging/package-info.java b/test/azure/src/main/java/fixtures/paging/package-info.java new file mode 100644 index 0000000000..97f3ff652a --- /dev/null +++ b/test/azure/src/main/java/fixtures/paging/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestPagingTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.paging; diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/Groups.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/Groups.java new file mode 100644 index 0000000000..bc2190aed9 --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/Groups.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.subscriptionidapiversion.models.ErrorException; +import fixtures.subscriptionidapiversion.models.SampleResourceGroup; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Groups. + */ +public interface Groups { + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SampleResourceGroup object if successful. + */ + SampleResourceGroup getSampleResourceGroup(String resourceGroupName); + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSampleResourceGroupAsync(String resourceGroupName, final ServiceCallback serviceCallback); + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SampleResourceGroup object + */ + Observable getSampleResourceGroupAsync(String resourceGroupName); + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SampleResourceGroup object + */ + Observable> getSampleResourceGroupWithServiceResponseAsync(String resourceGroupName); + +} diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/MicrosoftAzureTestUrl.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/MicrosoftAzureTestUrl.java new file mode 100644 index 0000000000..b4ec3a8772 --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/MicrosoftAzureTestUrl.java @@ -0,0 +1,113 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion; + +import com.microsoft.azure.AzureClient; +import com.microsoft.rest.RestClient; + +/** + * The interface for MicrosoftAzureTestUrl class. + */ +public interface MicrosoftAzureTestUrl { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + AzureClient getAzureClient(); + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + String userAgent(); + + /** + * Gets Subscription Id.. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Sets Subscription Id.. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + MicrosoftAzureTestUrl withSubscriptionId(String subscriptionId); + + /** + * Gets API Version with value '2014-04-01-preview'.. + * + * @return the apiVersion value. + */ + String apiVersion(); + + /** + * Gets Gets or sets the preferred language for the response.. + * + * @return the acceptLanguage value. + */ + String acceptLanguage(); + + /** + * Sets Gets or sets the preferred language for the response.. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + MicrosoftAzureTestUrl withAcceptLanguage(String acceptLanguage); + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @return the longRunningOperationRetryTimeout value. + */ + int longRunningOperationRetryTimeout(); + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + MicrosoftAzureTestUrl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout); + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @return the generateClientRequestId value. + */ + boolean generateClientRequestId(); + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + MicrosoftAzureTestUrl withGenerateClientRequestId(boolean generateClientRequestId); + + /** + * Gets the Groups object to access its operations. + * @return the Groups object. + */ + Groups groups(); + +} diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/GroupsImpl.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/GroupsImpl.java new file mode 100644 index 0000000000..2ce18c530e --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/GroupsImpl.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion.implementation; + +import retrofit2.Retrofit; +import fixtures.subscriptionidapiversion.Groups; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.subscriptionidapiversion.models.ErrorException; +import fixtures.subscriptionidapiversion.models.SampleResourceGroup; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Groups. + */ +public class GroupsImpl implements Groups { + /** The Retrofit service to perform REST calls. */ + private GroupsService service; + /** The service client containing this operation class. */ + private MicrosoftAzureTestUrlImpl client; + + /** + * Initializes an instance of GroupsImpl. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GroupsImpl(Retrofit retrofit, MicrosoftAzureTestUrlImpl client) { + this.service = retrofit.create(GroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Groups to be + * used by Retrofit to perform actually REST calls. + */ + interface GroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.subscriptionidapiversion.Groups getSampleResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + Observable> getSampleResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SampleResourceGroup object if successful. + */ + public SampleResourceGroup getSampleResourceGroup(String resourceGroupName) { + return getSampleResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body(); + } + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSampleResourceGroupAsync(String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSampleResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SampleResourceGroup object + */ + public Observable getSampleResourceGroupAsync(String resourceGroupName) { + return getSampleResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1, SampleResourceGroup>() { + @Override + public SampleResourceGroup call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SampleResourceGroup object + */ + public Observable> getSampleResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getSampleResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSampleResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSampleResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/MicrosoftAzureTestUrlImpl.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/MicrosoftAzureTestUrlImpl.java new file mode 100644 index 0000000000..3d7d512483 --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/MicrosoftAzureTestUrlImpl.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import fixtures.subscriptionidapiversion.Groups; +import fixtures.subscriptionidapiversion.MicrosoftAzureTestUrl; + +/** + * Initializes a new instance of the MicrosoftAzureTestUrlImpl class. + */ +public class MicrosoftAzureTestUrlImpl extends AzureServiceClient implements MicrosoftAzureTestUrl { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription Id. */ + private String subscriptionId; + + /** + * Gets Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription Id. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MicrosoftAzureTestUrlImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** API Version with value '2014-04-01-preview'. */ + private String apiVersion; + + /** + * Gets API Version with value '2014-04-01-preview'. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MicrosoftAzureTestUrlImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public MicrosoftAzureTestUrlImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public MicrosoftAzureTestUrlImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The Groups object to access its operations. + */ + private Groups groups; + + /** + * Gets the Groups object to access its operations. + * @return the Groups object. + */ + public Groups groups() { + return this.groups; + } + + /** + * Initializes an instance of MicrosoftAzureTestUrl client. + * + * @param credentials the management credentials for Azure + */ + public MicrosoftAzureTestUrlImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com/", credentials); + } + + /** + * Initializes an instance of MicrosoftAzureTestUrl client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MicrosoftAzureTestUrlImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MicrosoftAzureTestUrl client. + * + * @param restClient the REST client to connect to Azure. + */ + public MicrosoftAzureTestUrlImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2014-04-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.groups = new GroupsImpl(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "MicrosoftAzureTestUrl", "2014-04-01-preview"); + } +} diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/package-info.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/package-info.java new file mode 100644 index 0000000000..c4f55dd890 --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for MicrosoftAzureTestUrl. + * Some cool documentation. + */ +package fixtures.subscriptionidapiversion.implementation; diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/Error.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/Error.java new file mode 100644 index 0000000000..d29e28f1eb --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The code property. + */ + @JsonProperty(value = "code") + private Integer code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public Integer code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/ErrorException.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/ErrorException.java new file mode 100644 index 0000000000..e84d7e904d --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/SampleResourceGroup.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/SampleResourceGroup.java new file mode 100644 index 0000000000..a468960fd4 --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/SampleResourceGroup.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SampleResourceGroup model. + */ +public class SampleResourceGroup { + /** + * resource group name 'testgroup101'. + */ + @JsonProperty(value = "name") + private String name; + + /** + * resource group location 'West US'. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the SampleResourceGroup object itself. + */ + public SampleResourceGroup withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the SampleResourceGroup object itself. + */ + public SampleResourceGroup withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/package-info.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/package-info.java new file mode 100644 index 0000000000..bf0d22d96e --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for MicrosoftAzureTestUrl. + * Some cool documentation. + */ +package fixtures.subscriptionidapiversion.models; diff --git a/test/azure/src/main/java/fixtures/subscriptionidapiversion/package-info.java b/test/azure/src/main/java/fixtures/subscriptionidapiversion/package-info.java new file mode 100644 index 0000000000..f637222862 --- /dev/null +++ b/test/azure/src/main/java/fixtures/subscriptionidapiversion/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for MicrosoftAzureTestUrl. + * Some cool documentation. + */ +package fixtures.subscriptionidapiversion; diff --git a/test/azure/src/test/java/fixtures/azurecustombaseuri/AzureCustomBaseUriTests.java b/test/azure/src/test/java/fixtures/azurecustombaseuri/AzureCustomBaseUriTests.java new file mode 100644 index 0000000000..651a5001b2 --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurecustombaseuri/AzureCustomBaseUriTests.java @@ -0,0 +1,64 @@ +package fixtures.azurecustombaseuri; + +import com.microsoft.rest.credentials.TokenCredentials; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.custombaseuri.implementation.AutoRestParameterizedHostTestClientImpl; + +public class AzureCustomBaseUriTests { + private static AutoRestParameterizedHostTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestParameterizedHostTestClientImpl(new TokenCredentials(null, UUID.randomUUID().toString())); + } + + // Positive test case + @Test + public void getEmptyWithValidCustomUri() throws Exception { + client.withHost("host:3000"); + client.paths().getEmpty("local"); + } + + @Test + public void getEmptyWithInvalidCustomUriAccountName() throws Exception { + try { + client.paths().getEmpty("bad"); + Assert.assertTrue(false); + } + catch (RuntimeException e) { + Assert.assertTrue(true); + } + } + + @Test + public void getEmptyWithInvalidCustomUriHostName() throws Exception { + try { + client.withHost("badhost"); + client.paths().getEmpty("local"); + Assert.assertTrue(false); + } + catch (RuntimeException e) { + Assert.assertTrue(true); + } + finally { + client.withHost("host:3000"); + } + } + + @Test + public void getEmptyWithEmptyCustomUriAccountName() throws Exception { + try { + client.paths().getEmpty(null); + Assert.assertTrue(false); + } + catch (IllegalArgumentException e) { + Assert.assertTrue(true); + } + } +} diff --git a/test/azure/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java b/test/azure/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java new file mode 100644 index 0000000000..ace3881305 --- /dev/null +++ b/test/azure/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java @@ -0,0 +1,57 @@ +package fixtures.azureparametergrouping; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.azureparametergrouping.implementation.AutoRestParameterGroupingTestServiceImpl; +import fixtures.azureparametergrouping.models.FirstParameterGroup; +import fixtures.azureparametergrouping.models.ParameterGroupingPostMultiParamGroupsSecondParamGroup; +import fixtures.azureparametergrouping.models.ParameterGroupingPostOptionalParameters; +import fixtures.azureparametergrouping.models.ParameterGroupingPostRequiredParameters; + +public class ParameterGroupingTests { + private static AutoRestParameterGroupingTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestParameterGroupingTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void postRequired() throws Exception { + ParameterGroupingPostRequiredParameters params = new ParameterGroupingPostRequiredParameters(); + params.withBody(1234); + params.withPath("path"); + params.withQuery(21); + params.withCustomHeader("header"); + client.parameterGroupings().postRequired(params); + } + + @Test + public void postOptional() throws Exception { + ParameterGroupingPostOptionalParameters params = new ParameterGroupingPostOptionalParameters(); + params.withQuery(21); + params.withCustomHeader("header"); + client.parameterGroupings().postOptional(params); + } + + @Test + public void postMultipleParameterGroups() throws Exception { + FirstParameterGroup first = new FirstParameterGroup(); + first.withQueryOne(21); + first.withHeaderOne("header"); + ParameterGroupingPostMultiParamGroupsSecondParamGroup second = new ParameterGroupingPostMultiParamGroupsSecondParamGroup(); + second.withHeaderTwo("header2"); + second.withQueryTwo(42); + client.parameterGroupings().postMultiParamGroups(first, second); + } + + @Test + public void postParameterGroupWithSharedParameter() throws Exception { + FirstParameterGroup first = new FirstParameterGroup(); + first.withQueryOne(21); + first.withHeaderOne("header"); + client.parameterGroupings().postSharedParameterGroupObject(first); + } +} diff --git a/test/azure/src/test/java/fixtures/azurereport/CoverageReporter.java b/test/azure/src/test/java/fixtures/azurereport/CoverageReporter.java new file mode 100644 index 0000000000..495bdde955 --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurereport/CoverageReporter.java @@ -0,0 +1,38 @@ +package fixtures.azurereport; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import fixtures.azurereport.implementation.AutoRestReportServiceForAzureImpl; + +public final class CoverageReporter { + private static AutoRestReportServiceForAzureImpl client = new AutoRestReportServiceForAzureImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + + private CoverageReporter() { } + + public static void main(String[] args) throws Exception { + Map report = client.getReport(); + + // Pending URL encoding + report.put("AzureMethodQueryUrlEncoding", 1); + report.put("AzurePathQueryUrlEncoding", 1); + report.put("AzureSwaggerQueryUrlEncoding", 1); + + int total = report.size(); + int hit = 0; + List missing = new ArrayList(); + for (Map.Entry entry : report.entrySet()) { + if (entry.getValue() != 0) { + hit++; + } else { + missing.add(entry.getKey()); + } + } + System.out.println(hit + " out of " + total + " tests hit. Missing tests:"); + for (String scenario : missing) { + System.out.println(scenario); + } + } +} diff --git a/test/azure/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java b/test/azure/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java new file mode 100644 index 0000000000..4814fdc5e6 --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java @@ -0,0 +1,42 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +public class ApiVersionDefaultTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void getMethodGlobalValid() throws Exception { + ServiceResponse response = client.apiVersionDefaults().getMethodGlobalValidWithServiceResponseAsync().toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } + + @Test + public void getMethodGlobalNotProvidedValid() throws Exception { + ServiceResponse response = client.apiVersionDefaults().getMethodGlobalNotProvidedValidWithServiceResponseAsync().toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } + + @Test + public void getPathGlobalValid() throws Exception { + ServiceResponse response = client.apiVersionDefaults().getPathGlobalValidWithServiceResponseAsync().toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } + + @Test + public void getSwaggerGlobalValid() throws Exception { + ServiceResponse response = client.apiVersionDefaults().getSwaggerGlobalValidWithServiceResponseAsync().toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } +} diff --git a/test/azure/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java b/test/azure/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java new file mode 100644 index 0000000000..28588b563b --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java @@ -0,0 +1,42 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +public class ApiVersionLocalTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void getMethodLocalValid() throws Exception { + ServiceResponse response = client.apiVersionLocals().getMethodLocalValidWithServiceResponseAsync().toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } + + @Test + public void getMethodGlobalNotProvidedValid() throws Exception { + ServiceResponse response = client.apiVersionLocals().getMethodLocalNullWithServiceResponseAsync().toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } + + @Test + public void getPathGlobalValid() throws Exception { + ServiceResponse response = client.apiVersionLocals().getPathLocalValidWithServiceResponseAsync().toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } + + @Test + public void getSwaggerGlobalValid() throws Exception { + ServiceResponse response = client.apiVersionLocals().getSwaggerLocalValidWithServiceResponseAsync().toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } +} diff --git a/test/azure/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java b/test/azure/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java new file mode 100644 index 0000000000..2832b4a730 --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java @@ -0,0 +1,46 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceResponseWithHeaders; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdHeadHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdParamGroupingHeaders; +import fixtures.azurespecials.models.HeaderCustomNamedRequestIdParamGroupingParameters; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class HeaderOperationsTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void customNamedRequestId() throws Exception { + ServiceResponseWithHeaders response = client.headers().customNamedRequestIdWithServiceResponseAsync("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0").toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + Assert.assertEquals("123", response.headers().fooRequestId()); + } + + @Test + public void customNamedRequestIdParamGrouping() throws Exception { + HeaderCustomNamedRequestIdParamGroupingParameters group = new HeaderCustomNamedRequestIdParamGroupingParameters(); + group.withFooClientRequestId("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0"); + ServiceResponseWithHeaders response = client.headers().customNamedRequestIdParamGroupingWithServiceResponseAsync(group).toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + Assert.assertEquals("123", response.headers().fooRequestId()); + } + + @Test + public void customNamedRequestIdHead() throws Exception { + ServiceResponseWithHeaders response = client.headers().customNamedRequestIdHeadWithServiceResponseAsync("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0").toBlocking().last(); + Assert.assertEquals(200, response.headResponse().code()); + Assert.assertTrue(response.body()); + Assert.assertEquals("123", response.headers().fooRequestId()); + } +} diff --git a/test/azure/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java b/test/azure/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java new file mode 100644 index 0000000000..c689e4b14a --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java @@ -0,0 +1,57 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +public class SkipUrlEncodingTests { + private static String baseUrl = "http://localhost:3000"; + private static String unencodedPath = "path1/path2/path3"; + private static String unencodedQuery = "value1&q2=value2&q3=value3"; + + private static SkipUrlEncodings client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl(baseUrl, new BasicAuthenticationCredentials(null, null)).skipUrlEncodings(); + } + + @Test + public void getMethodPathValid() throws Exception { + client.getMethodPathValid(unencodedPath); + } + + @Test + public void getPathPathValid() throws Exception { + client.getPathPathValid(unencodedPath); + } + + @Test + public void getSwaggerPathValid() throws Exception { + client.getSwaggerPathValid(); + } + + @Ignore("Not supported by OkHttp: https://github.com/square/okhttp/issues/2623") + public void getMethodQueryValid() throws Exception { + client.getMethodQueryValid(unencodedQuery); + } + + @Ignore("Not supported by OkHttp: https://github.com/square/okhttp/issues/2623") + public void getPathQueryValid() throws Exception { + client.getPathQueryValid(unencodedQuery); + } + + @Ignore("Not supported by OkHttp: https://github.com/square/okhttp/issues/2623") + public void getSwaggerQueryValid() throws Exception { + client.getSwaggerQueryValid(); + } + + @Test + public void getMethodQueryNull() throws Exception { + client.getMethodQueryNull(null); + } + +} diff --git a/test/azure/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java b/test/azure/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java new file mode 100644 index 0000000000..963da274f7 --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java @@ -0,0 +1,51 @@ +package fixtures.azurespecials; + +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.interceptors.RequestIdHeaderInterceptor; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.TokenCredentials; + +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +public class SubscriptionInCredentialsTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + RestClient restClient = new RestClient.Builder() + .withBaseUrl("http://localhost:3000") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .withCredentials(new TokenCredentials(null, UUID.randomUUID().toString())) + .withInterceptor(new RequestIdHeaderInterceptor()) + .build(); + client = new AutoRestAzureSpecialParametersTestClientImpl(restClient); + client.withSubscriptionId("1234-5678-9012-3456"); + } + + @Test + public void postMethodGlobalValid() throws Exception { + client.subscriptionInCredentials().postMethodGlobalValid(); + } + + @Test + public void postMethodGlobalNotProvidedValid() throws Exception { + client.subscriptionInCredentials().postMethodGlobalNotProvidedValid(); + } + + @Test + public void postPathGlobalValid() throws Exception { + client.subscriptionInCredentials().postPathGlobalValid(); + } + + @Test + public void postSwaggerGlobalValid() throws Exception { + client.subscriptionInCredentials().postSwaggerGlobalValid(); + } +} diff --git a/test/azure/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java b/test/azure/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java new file mode 100644 index 0000000000..cf4d33bf36 --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java @@ -0,0 +1,59 @@ +package fixtures.azurespecials; + +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.interceptors.RequestIdHeaderInterceptor; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.TokenCredentials; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +import static org.junit.Assert.fail; + +public class SubscriptionInMethodTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + RestClient restClient = new RestClient.Builder() + .withBaseUrl("http://localhost:3000") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .withCredentials(new TokenCredentials(null, UUID.randomUUID().toString())) + .withInterceptor(new RequestIdHeaderInterceptor()) + .build(); + client = new AutoRestAzureSpecialParametersTestClientImpl(restClient); + client.withSubscriptionId("1234-5678-9012-3456"); + } + + @Test + public void postMethodLocalValid() throws Exception { + client.subscriptionInMethods().postMethodLocalValid("1234-5678-9012-3456"); + } + + @Test + public void postMethodLocalNull() throws Exception { + try { + client.subscriptionInMethods().postMethodLocalNull(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter subscriptionId is required")); + } + } + + @Test + public void postPathLocalValid() throws Exception { + client.subscriptionInMethods().postPathLocalValid("1234-5678-9012-3456"); + } + + @Test + public void postSwaggerLocalValid() throws Exception { + client.subscriptionInMethods().postSwaggerLocalValid("1234-5678-9012-3456"); + } +} diff --git a/test/azure/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java b/test/azure/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java new file mode 100644 index 0000000000..662775eb4d --- /dev/null +++ b/test/azure/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java @@ -0,0 +1,36 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.credentials.TokenCredentials; +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +public class XMsClientRequestIdTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new TokenCredentials(null, UUID.randomUUID().toString())); + client.withSubscriptionId("1234-5678-9012-3456"); + } + + @Test + public void get() throws Exception { + client.restClient().headers().removeHeader("x-ms-client-request-id"); + client.restClient().headers().addHeader("x-ms-client-request-id", "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0"); + ServiceResponse response = client.xMsClientRequestIds().getWithServiceResponseAsync().toBlocking().last(); + client.restClient().headers().removeHeader("x-ms-client-request-id"); + Assert.assertEquals(200, response.response().code()); + } + + @Test + public void paramGet() throws Exception { + client.restClient().headers().removeHeader("x-ms-client-request-id"); + ServiceResponse response = client.xMsClientRequestIds().paramGetWithServiceResponseAsync("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0").toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + } +} diff --git a/test/azure/src/test/java/fixtures/head/HttpSuccessTests.java b/test/azure/src/test/java/fixtures/head/HttpSuccessTests.java new file mode 100644 index 0000000000..c83b219c4f --- /dev/null +++ b/test/azure/src/test/java/fixtures/head/HttpSuccessTests.java @@ -0,0 +1,33 @@ +package fixtures.head; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import okhttp3.logging.HttpLoggingInterceptor; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.head.implementation.AutoRestHeadTestServiceImpl; + +public class HttpSuccessTests { + private static AutoRestHeadTestServiceImpl client; + + @BeforeClass + public static void setup() throws Exception { + client = new AutoRestHeadTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void head200() throws Exception { + Assert.assertTrue(client.httpSuccess().head200()); + } + + @Test + public void head204() throws Exception { + Assert.assertTrue(client.httpSuccess().head204()); + } + + @Test + public void head404() throws Exception { + Assert.assertFalse(client.httpSuccess().head404()); + } +} diff --git a/test/azure/src/test/java/fixtures/headexceptions/HeadExceptionTests.java b/test/azure/src/test/java/fixtures/headexceptions/HeadExceptionTests.java new file mode 100644 index 0000000000..d67dfe0d09 --- /dev/null +++ b/test/azure/src/test/java/fixtures/headexceptions/HeadExceptionTests.java @@ -0,0 +1,32 @@ +package fixtures.headexceptions; + +import com.microsoft.rest.RestException; +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.headexceptions.implementation.AutoRestHeadExceptionTestServiceImpl; + +public class HeadExceptionTests { + private static AutoRestHeadExceptionTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestHeadExceptionTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void headException200() throws Exception { + client.headExceptions().head200(); + } + + @Test + public void headException204() throws Exception { + client.headExceptions().head204(); + } + + @Test(expected = RestException.class) + public void headException404() throws Exception { + client.headExceptions().head404(); + } +} diff --git a/test/azure/src/test/java/fixtures/lro/LRORetrysTests.java b/test/azure/src/test/java/fixtures/lro/LRORetrysTests.java new file mode 100644 index 0000000000..64f0d55e32 --- /dev/null +++ b/test/azure/src/test/java/fixtures/lro/LRORetrysTests.java @@ -0,0 +1,71 @@ +package fixtures.lro; + +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl; +import fixtures.lro.models.Product; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class LRORetrysTests { + private static AutoRestLongRunningOperationTestServiceImpl client; + + @BeforeClass + public static void setup() { + RestClient restClient = new RestClient.Builder() + .withBaseUrl("http://localhost:3000") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(); + client = new AutoRestLongRunningOperationTestServiceImpl(restClient); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + } + + @Test + public void put201CreatingSucceeded200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lRORetrys().put201CreatingSucceeded200(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncRelativeRetrySucceeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lRORetrys().putAsyncRelativeRetrySucceeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void deleteProvisioning202Accepted200Succeeded() throws Exception { + Product response = client.lRORetrys().deleteProvisioning202Accepted200Succeeded(); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void delete202Retry200() throws Exception { + client.lRORetrys().delete202Retry200(); + } + + @Test + public void deleteAsyncRelativeRetrySucceeded() throws Exception { + client.lRORetrys().deleteAsyncRelativeRetrySucceeded(); + } + + @Test + public void post202Retry200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + client.lRORetrys().post202Retry200(product); + } + + @Test + public void postAsyncRelativeRetrySucceeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + client.lRORetrys().postAsyncRelativeRetrySucceeded(product); + } +} diff --git a/test/azure/src/test/java/fixtures/lro/LROSADsTests.java b/test/azure/src/test/java/fixtures/lro/LROSADsTests.java new file mode 100644 index 0000000000..07b4c2b2ac --- /dev/null +++ b/test/azure/src/test/java/fixtures/lro/LROSADsTests.java @@ -0,0 +1,308 @@ +package fixtures.lro; + +import com.microsoft.azure.CloudException; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl; +import fixtures.lro.models.Product; + +import static org.junit.Assert.fail; + +public class LROSADsTests { + private static AutoRestLongRunningOperationTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + } + + @Test + public void putNonRetry400() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().putNonRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void putNonRetry201Creating400() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().putNonRetry201Creating400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void putAsyncRelativeRetry400() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void deleteNonRetry400() throws Exception { + try { + client.lROSADs().deleteNonRetry400(); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void delete202NonRetry400() throws Exception { + try { + client.lROSADs().delete202NonRetry400(); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void deleteAsyncRelativeRetry400() throws Exception { + try { + client.lROSADs().deleteAsyncRelativeRetry400(); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void postNonRetry400() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().postNonRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void post202NonRetry400() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().post202NonRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void postAsyncRelativeRetry400() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().postAsyncRelativeRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void putError201NoProvisioningStatePayload() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().putError201NoProvisioningStatePayload(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void putAsyncRelativeRetryNoStatus() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetryNoStatus(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void putAsyncRelativeRetryNoStatusPayload() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetryNoStatusPayload(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void delete204Succeeded() throws Exception { + client.lROSADs().delete204Succeeded(); + } + + @Test + public void deleteAsyncRelativeRetryNoStatus() throws Exception { + try { + client.lROSADs().deleteAsyncRelativeRetryNoStatus(); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void post202NoLocation() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().post202NoLocation(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(202, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("Response does not contain an Azure")); + } + } + + @Test + public void postAsyncRelativeRetryNoPayload() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().postAsyncRelativeRetryNoPayload(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void put200InvalidJson() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().put200InvalidJson(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("Unexpected end-of-input")); + } + } + + @Test + public void putAsyncRelativeRetryInvalidHeader() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetryInvalidHeader(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void putAsyncRelativeRetryInvalidJsonPolling() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetryInvalidJsonPolling(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void delete202RetryInvalidHeader() throws Exception { + try { + client.lROSADs().delete202RetryInvalidHeader(); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void deleteAsyncRelativeRetryInvalidHeader() throws Exception { + try { + client.lROSADs().deleteAsyncRelativeRetryInvalidHeader(); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void deleteAsyncRelativeRetryInvalidJsonPolling() throws Exception { + try { + client.lROSADs().deleteAsyncRelativeRetryInvalidJsonPolling(); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void post202RetryInvalidHeader() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().post202RetryInvalidHeader(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void postAsyncRelativeRetryInvalidHeader() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().postAsyncRelativeRetryInvalidHeader(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void postAsyncRelativeRetryInvalidJsonPolling() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + client.lROSADs().postAsyncRelativeRetryInvalidJsonPolling(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("polling response does not contain a valid body")); + } + } +} diff --git a/test/azure/src/test/java/fixtures/lro/LROsCustomHeaderTests.java b/test/azure/src/test/java/fixtures/lro/LROsCustomHeaderTests.java new file mode 100644 index 0000000000..dc5a595a8e --- /dev/null +++ b/test/azure/src/test/java/fixtures/lro/LROsCustomHeaderTests.java @@ -0,0 +1,58 @@ +package fixtures.lro; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl; +import fixtures.lro.models.Product; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.Map; + +public class LROsCustomHeaderTests { + private static AutoRestLongRunningOperationTestServiceImpl client; + private static Map customHeaders; + + @BeforeClass + public static void setup() { + client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + client.restClient().headers().addHeader("x-ms-client-request-id", "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0"); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + } + + @AfterClass + public static void cleanup() { + client.restClient().headers().removeHeader("x-ms-client-request-id"); + } + + @Test + public void putAsyncRetrySucceeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROsCustomHeaders().putAsyncRetrySucceeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void put201CreatingSucceeded200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROsCustomHeaders().put201CreatingSucceeded200(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void post202Retry200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + client.lROsCustomHeaders().post202Retry200(product); + } + + @Test + public void postAsyncRetrySucceeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + client.lROsCustomHeaders().postAsyncRetrySucceeded(product); + } +} diff --git a/test/azure/src/test/java/fixtures/lro/LROsTests.java b/test/azure/src/test/java/fixtures/lro/LROsTests.java new file mode 100644 index 0000000000..6b2fd9c3fa --- /dev/null +++ b/test/azure/src/test/java/fixtures/lro/LROsTests.java @@ -0,0 +1,342 @@ +package fixtures.lro; + +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl; +import fixtures.lro.models.Product; +import fixtures.lro.models.Sku; +import fixtures.lro.models.SubProduct; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.fail; + +public class LROsTests { + private static AutoRestLongRunningOperationTestServiceImpl client; + + @BeforeClass + public static void setup() { + RestClient restClient = new RestClient.Builder() + .withBaseUrl("http://localhost:3000") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(); + client = new AutoRestLongRunningOperationTestServiceImpl(restClient); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + } + + @Test + public void put200Succeeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().put200Succeeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void put200SucceededNoState() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().put200SucceededNoState(product); + Assert.assertEquals("100", response.id()); + } + + @Test + public void put202Retry200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().put202Retry200(product); + Assert.assertEquals("100", response.id()); + } + + @Ignore("Can cause flakiness - only run manually") + public void put202Retry200Async() throws Exception { + final CountDownLatch lock = new CountDownLatch(1); + long startTime = System.currentTimeMillis(); + final long[] callbackTime = new long[1]; + Product product = new Product(); + product.withLocation("West US"); + client.getAzureClient().setLongRunningOperationRetryTimeout(1); + client.lROs().put202Retry200Async(product, new ServiceCallback() { + @Override + public void failure(Throwable t) { + fail(); + } + + @Override + public void success(Product result) { + Assert.assertEquals("100", result.id()); + callbackTime[0] = System.currentTimeMillis(); + lock.countDown(); + } + }); + long endTime = System.currentTimeMillis(); + Assert.assertTrue(500 > endTime - startTime); + Assert.assertTrue(lock.await(3000, TimeUnit.MILLISECONDS)); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + Assert.assertTrue(1000 < callbackTime[0] - startTime); + } + + @Test + public void put201CreatingSucceeded200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().put201CreatingSucceeded200(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void put200UpdatingSucceeded204() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().put200UpdatingSucceeded204(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void put201CreatingFailed200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + Product response = client.lROs().put201CreatingFailed200(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage()); + } + } + + @Test + public void put200Acceptedcanceled200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + Product response = client.lROs().put200Acceptedcanceled200(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage()); + } + } + + @Test + public void putNoHeaderInRetry() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().putNoHeaderInRetry(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncRetrySucceeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().putAsyncRetrySucceeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncNoRetrySucceeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().putAsyncNoRetrySucceeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncRetryFailed() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + Product response = client.lROs().putAsyncRetryFailed(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage()); + } + } + + @Test + public void putAsyncNoRetrycanceled() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + try { + Product response = client.lROs().putAsyncNoRetrycanceled(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage()); + } + } + + @Test + public void putAsyncNoHeaderInRetry() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().putAsyncNoHeaderInRetry(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putNonResource() throws Exception { + Sku sku = new Sku(); + Sku response = client.lROs().putNonResource(sku); + Assert.assertEquals("100", response.id()); + } + + @Test + public void putAsyncNonResource() throws Exception { + Sku sku = new Sku(); + Sku response = client.lROs().putAsyncNonResource(sku); + Assert.assertEquals("100", response.id()); + } + + @Test + public void putSubResource() throws Exception { + SubProduct subProduct = new SubProduct(); + SubProduct response = client.lROs().putSubResource(subProduct); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncSubResource() throws Exception { + SubProduct subProduct = new SubProduct(); + SubProduct response = client.lROs().putAsyncSubResource(subProduct); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void deleteProvisioning202Accepted200Succeeded() throws Exception { + Product response = client.lROs().deleteProvisioning202Accepted200Succeeded(); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void deleteProvisioning202DeletingFailed200() throws Exception { + Product response = client.lROs().deleteProvisioning202DeletingFailed200(); + Assert.assertEquals("Failed", response.provisioningState()); + } + + @Test + public void deleteProvisioning202Deletingcanceled200() throws Exception { + Product response = client.lROs().deleteProvisioning202Deletingcanceled200(); + Assert.assertEquals("Canceled", response.provisioningState()); + } + + @Test + public void delete204Succeeded() throws Exception { + client.lROs().delete204Succeeded(); + } + + @Test + public void delete202Retry200() throws Exception { + Product response = client.lROs().delete202Retry200(); + } + + @Test + public void delete202NoRetry204() throws Exception { + Product response = client.lROs().delete202NoRetry204(); + } + + @Test + public void deleteNoHeaderInRetry() throws Exception { + client.lROs().deleteNoHeaderInRetry(); + } + + @Test + public void deleteAsyncNoHeaderInRetry() throws Exception { + client.lROs().deleteAsyncNoHeaderInRetry(); + } + + @Test + public void deleteAsyncRetrySucceeded() throws Exception { + client.lROs().deleteAsyncRetrySucceeded(); + } + + @Test + public void deleteAsyncNoRetrySucceeded() throws Exception { + client.lROs().deleteAsyncNoRetrySucceeded(); + } + + @Test + public void deleteAsyncRetryFailed() throws Exception { + try { + client.lROs().deleteAsyncRetryFailed(); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage()); + } + } + + @Test + public void deleteAsyncRetrycanceled() throws Exception { + try { + client.lROs().deleteAsyncRetrycanceled(); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage()); + } + } + + @Test + public void post200WithPayload() throws Exception { + Sku response = client.lROs().post200WithPayload(); + Assert.assertEquals("1", response.id()); + } + + @Test + public void post202Retry200() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + client.lROs().post202Retry200(product); + } + + @Test + public void post202NoRetry204() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().post202NoRetry204(product); + } + + @Test + public void postAsyncRetrySucceeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().postAsyncRetrySucceeded(product); + } + + @Test + public void postAsyncNoRetrySucceeded() throws Exception { + Product product = new Product(); + product.withLocation("West US"); + Product response = client.lROs().postAsyncNoRetrySucceeded(product); + } + + @Test + public void postAsyncRetryFailed() throws Exception { + try { + Product product = new Product(); + product.withLocation("West US"); + client.lROs().postAsyncRetryFailed(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage()); + } + } + + @Test + public void postAsyncRetrycanceled() throws Exception { + try { + Product product = new Product(); + product.withLocation("West US"); + client.lROs().postAsyncRetrycanceled(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage()); + } + } +} diff --git a/test/azure/src/test/java/fixtures/paging/PagingTests.java b/test/azure/src/test/java/fixtures/paging/PagingTests.java new file mode 100644 index 0000000000..a27580fe05 --- /dev/null +++ b/test/azure/src/test/java/fixtures/paging/PagingTests.java @@ -0,0 +1,158 @@ +package fixtures.paging; + +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.LogLevel; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import com.microsoft.rest.interceptors.LoggingInterceptor; +import fixtures.paging.implementation.AutoRestPagingTestServiceImpl; +import fixtures.paging.models.CustomParameterGroup; +import fixtures.paging.models.PagingGetMultiplePagesWithOffsetOptions; +import fixtures.paging.models.Product; +import fixtures.paging.models.ProductProperties; +import okhttp3.logging.HttpLoggingInterceptor; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.fail; + +public class PagingTests { + private static AutoRestPagingTestServiceImpl client; + + @BeforeClass + public static void setup() { + RestClient restClient = new RestClient.Builder() + .withBaseUrl("http://localhost:3000") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(); + client = new AutoRestPagingTestServiceImpl(restClient);; + } + + @Test + public void getSinglePages() throws Exception { + List response = client.pagings().getSinglePages(); + Assert.assertEquals(1, response.size()); + } + + @Test + public void getMultiplePages() throws Exception { + List response = client.pagings().getMultiplePages(); + Product p1 = new Product(); + p1.withProperties(new ProductProperties()); + response.add(p1); + response.get(3); + Product p4 = new Product(); + p4.withProperties(new ProductProperties()); + response.add(p4); + int i = 0; + for (Product p : response) { + if (++i == 7) { + break; + } + } + Assert.assertEquals(12, response.size()); + Assert.assertEquals(1, response.indexOf(p1)); + Assert.assertEquals(4, response.indexOf(p4)); + } + + @Test + public void getOdataMultiplePages() throws Exception { + List response = client.pagings().getOdataMultiplePages(); + Assert.assertEquals(10, response.size()); + } + + @Test + public void getMultiplePagesWithOffset() throws Exception { + PagingGetMultiplePagesWithOffsetOptions options = new PagingGetMultiplePagesWithOffsetOptions(); + options.withOffset(100); + List response = client.pagings().getMultiplePagesWithOffset(options, "client-id"); + Assert.assertEquals(10, response.size()); + Assert.assertEquals(110, (int) response.get(response.size() - 1).properties().id()); + } + + @Test + public void getMultiplePagesAsync() throws Exception { + final CountDownLatch lock = new CountDownLatch(1); + client.pagings().getMultiplePagesAsync("client-id", null, new ListOperationCallback() { + @Override + public void failure(Throwable t) { + fail(); + } + + @Override + public void success() { + lock.countDown(); + } + + @Override + public PagingBehavior progress(List partial) { + if (pageCount() == 7) { + return PagingBehavior.STOP; + } else { + return PagingBehavior.CONTINUE; + } + } + }); + Assert.assertTrue(lock.await(10000, TimeUnit.MILLISECONDS)); + } + + @Test + public void getMultiplePagesRetryFirst() throws Exception { + List response = client.pagings().getMultiplePagesRetryFirst(); + Assert.assertEquals(10, response.size()); + } + + @Test + public void getMultiplePagesRetrySecond() throws Exception { + List response = client.pagings().getMultiplePagesRetrySecond(); + Assert.assertEquals(10, response.size()); + } + + @Test + public void getSinglePagesFailure() throws Exception { + try { + List response = client.pagings().getSinglePagesFailure(); + fail(); + } catch (CloudException ex) { + Assert.assertNotNull(ex.response()); + } + } + + @Test + public void getMultiplePagesFailure() throws Exception { + try { + List response = client.pagings().getMultiplePagesFailure(); + response.size(); + fail(); + } catch (CloudException ex) { + Assert.assertNotNull(ex.response()); + } + } + + @Test + public void getMultiplePagesFailureUri() throws Exception { + List response = client.pagings().getMultiplePagesFailureUri(); + Assert.assertEquals(1, response.size()); + } + + @Test + public void getMultiplePagesFragmentNextLink() throws Exception { + List response = client.pagings().getMultiplePagesFragmentNextLink("test_user", "1.6"); + Assert.assertEquals(10, response.size()); + } + + @Test + public void getMultiplePagesFragmentWithGroupingNextLink() throws Exception { + List response = client.pagings().getMultiplePagesFragmentWithGroupingNextLink(new CustomParameterGroup().withTenant("test_user").withApiVersion("1.6")); + Assert.assertEquals(10, response.size()); + } +} diff --git a/test/azure/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java b/test/azure/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java new file mode 100644 index 0000000000..059119abed --- /dev/null +++ b/test/azure/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java @@ -0,0 +1,28 @@ +package fixtures.subscriptionidapiversion; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.subscriptionidapiversion.implementation.MicrosoftAzureTestUrlImpl; +import fixtures.subscriptionidapiversion.models.SampleResourceGroup; + +public class GroupTests { + private static MicrosoftAzureTestUrlImpl client; + + @BeforeClass + public static void setup() { + client = new MicrosoftAzureTestUrlImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void getSampleResourceGroup() throws Exception { + client.withSubscriptionId(UUID.randomUUID().toString()); + SampleResourceGroup group = client.groups().getSampleResourceGroup("testgroup101"); + Assert.assertEquals("testgroup101", group.name()); + Assert.assertEquals("West US", group.location()); + } +} diff --git a/test/azurefluent/pom.xml b/test/azurefluent/pom.xml new file mode 100644 index 0000000000..6632aec530 --- /dev/null +++ b/test/azurefluent/pom.xml @@ -0,0 +1,145 @@ + + + 4.0.0 + + com.microsoft.azure + autorest-java + 1.0.0-SNAPSHOT + ../../pom.xml + + + fluent-codegen-tests + jar + + AutoRest Java Fluent Code Generator Tests + This package contains the tests for the Azure Java code generator for the fluent clients. + https://github.com/Azure/autorest + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/autorest + scm:git:git@github.com:Azure/autorest.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + com.microsoft.azure + azure-mgmt-resources + + + com.microsoft.azure + azure-client-runtime + + + junit + junit + test + + + junit + junit-dep + test + + + org.slf4j + slf4j-simple + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+ + + exec-maven-plugin + org.codehaus.mojo + 1.5.0 + + + run-server + test-compile + + exec + + + node + ${session.executionRootDirectory} + + node_modules/@microsoft.azure/autorest.testserver + + true + + + + report-coverage + test + + java + + + fixtures.azurereport.CoverageReporter + test + false + + + + +
+
+
diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/Error.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/Error.java new file mode 100644 index 0000000000..1ce3c6ad9c --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/ErrorException.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/ErrorException.java new file mode 100644 index 0000000000..dc866785ad --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java new file mode 100644 index 0000000000..dea12af27e --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/AutoRestParameterGroupingTestServiceImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AutoRestParameterGroupingTestServiceImpl class. + */ +public class AutoRestParameterGroupingTestServiceImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestParameterGroupingTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestParameterGroupingTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestParameterGroupingTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ParameterGroupingsInner object to access its operations. + */ + private ParameterGroupingsInner parameterGroupings; + + /** + * Gets the ParameterGroupingsInner object to access its operations. + * @return the ParameterGroupingsInner object. + */ + public ParameterGroupingsInner parameterGroupings() { + return this.parameterGroupings; + } + + /** + * Initializes an instance of AutoRestParameterGroupingTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestParameterGroupingTestServiceImpl(ServiceClientCredentials credentials) { + this("https://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestParameterGroupingTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestParameterGroupingTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterGroupingTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestParameterGroupingTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.parameterGroupings = new ParameterGroupingsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestParameterGroupingTestService", "1.0.0"); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/FirstParameterGroupInner.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/FirstParameterGroupInner.java new file mode 100644 index 0000000000..bfdd4668e5 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/FirstParameterGroupInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for a set of operations, such as: + * ParameterGrouping_postMultiParamGroups, + * ParameterGrouping_postSharedParameterGroupObject. + */ +public class FirstParameterGroupInner { + /** + * The headerOne property. + */ + @JsonProperty(value = "") + private String headerOne; + + /** + * Query parameter with default. + */ + @JsonProperty(value = "") + private Integer queryOne; + + /** + * Get the headerOne value. + * + * @return the headerOne value + */ + public String headerOne() { + return this.headerOne; + } + + /** + * Set the headerOne value. + * + * @param headerOne the headerOne value to set + * @return the FirstParameterGroupInner object itself. + */ + public FirstParameterGroupInner withHeaderOne(String headerOne) { + this.headerOne = headerOne; + return this; + } + + /** + * Get the queryOne value. + * + * @return the queryOne value + */ + public Integer queryOne() { + return this.queryOne; + } + + /** + * Set the queryOne value. + * + * @param queryOne the queryOne value to set + * @return the FirstParameterGroupInner object itself. + */ + public FirstParameterGroupInner withQueryOne(Integer queryOne) { + this.queryOne = queryOne; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostMultiParamGroupsSecondParamGroupInner.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostMultiParamGroupsSecondParamGroupInner.java new file mode 100644 index 0000000000..d00b99d255 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostMultiParamGroupsSecondParamGroupInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for postMultiParamGroups operation. + */ +public class ParameterGroupingPostMultiParamGroupsSecondParamGroupInner { + /** + * The headerTwo property. + */ + @JsonProperty(value = "") + private String headerTwo; + + /** + * Query parameter with default. + */ + @JsonProperty(value = "") + private Integer queryTwo; + + /** + * Get the headerTwo value. + * + * @return the headerTwo value + */ + public String headerTwo() { + return this.headerTwo; + } + + /** + * Set the headerTwo value. + * + * @param headerTwo the headerTwo value to set + * @return the ParameterGroupingPostMultiParamGroupsSecondParamGroupInner object itself. + */ + public ParameterGroupingPostMultiParamGroupsSecondParamGroupInner withHeaderTwo(String headerTwo) { + this.headerTwo = headerTwo; + return this; + } + + /** + * Get the queryTwo value. + * + * @return the queryTwo value + */ + public Integer queryTwo() { + return this.queryTwo; + } + + /** + * Set the queryTwo value. + * + * @param queryTwo the queryTwo value to set + * @return the ParameterGroupingPostMultiParamGroupsSecondParamGroupInner object itself. + */ + public ParameterGroupingPostMultiParamGroupsSecondParamGroupInner withQueryTwo(Integer queryTwo) { + this.queryTwo = queryTwo; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostOptionalParametersInner.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostOptionalParametersInner.java new file mode 100644 index 0000000000..f1171e4059 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostOptionalParametersInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for postOptional operation. + */ +public class ParameterGroupingPostOptionalParametersInner { + /** + * The customHeader property. + */ + @JsonProperty(value = "") + private String customHeader; + + /** + * Query parameter with default. + */ + @JsonProperty(value = "") + private Integer query; + + /** + * Get the customHeader value. + * + * @return the customHeader value + */ + public String customHeader() { + return this.customHeader; + } + + /** + * Set the customHeader value. + * + * @param customHeader the customHeader value to set + * @return the ParameterGroupingPostOptionalParametersInner object itself. + */ + public ParameterGroupingPostOptionalParametersInner withCustomHeader(String customHeader) { + this.customHeader = customHeader; + return this; + } + + /** + * Get the query value. + * + * @return the query value + */ + public Integer query() { + return this.query; + } + + /** + * Set the query value. + * + * @param query the query value to set + * @return the ParameterGroupingPostOptionalParametersInner object itself. + */ + public ParameterGroupingPostOptionalParametersInner withQuery(Integer query) { + this.query = query; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostRequiredParametersInner.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostRequiredParametersInner.java new file mode 100644 index 0000000000..4bafbf493e --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingPostRequiredParametersInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for postRequired operation. + */ +public class ParameterGroupingPostRequiredParametersInner { + /** + * The body property. + */ + @JsonProperty(value = "", required = true) + private int body; + + /** + * The customHeader property. + */ + @JsonProperty(value = "") + private String customHeader; + + /** + * Query parameter with default. + */ + @JsonProperty(value = "") + private Integer query; + + /** + * Path parameter. + */ + @JsonProperty(value = "", required = true) + private String path; + + /** + * Get the body value. + * + * @return the body value + */ + public int body() { + return this.body; + } + + /** + * Set the body value. + * + * @param body the body value to set + * @return the ParameterGroupingPostRequiredParametersInner object itself. + */ + public ParameterGroupingPostRequiredParametersInner withBody(int body) { + this.body = body; + return this; + } + + /** + * Get the customHeader value. + * + * @return the customHeader value + */ + public String customHeader() { + return this.customHeader; + } + + /** + * Set the customHeader value. + * + * @param customHeader the customHeader value to set + * @return the ParameterGroupingPostRequiredParametersInner object itself. + */ + public ParameterGroupingPostRequiredParametersInner withCustomHeader(String customHeader) { + this.customHeader = customHeader; + return this; + } + + /** + * Get the query value. + * + * @return the query value + */ + public Integer query() { + return this.query; + } + + /** + * Set the query value. + * + * @param query the query value to set + * @return the ParameterGroupingPostRequiredParametersInner object itself. + */ + public ParameterGroupingPostRequiredParametersInner withQuery(Integer query) { + this.query = query; + return this; + } + + /** + * Get the path value. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path value. + * + * @param path the path value to set + * @return the ParameterGroupingPostRequiredParametersInner object itself. + */ + public ParameterGroupingPostRequiredParametersInner withPath(String path) { + this.path = path; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsInner.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsInner.java new file mode 100644 index 0000000000..4ba3de63bf --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/ParameterGroupingsInner.java @@ -0,0 +1,586 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureparametergrouping.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.azureparametergrouping.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ParameterGroupings. + */ +public class ParameterGroupingsInner { + /** The Retrofit service to perform REST calls. */ + private ParameterGroupingsService service; + /** The service client containing this operation class. */ + private AutoRestParameterGroupingTestServiceImpl client; + + /** + * Initializes an instance of ParameterGroupingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ParameterGroupingsInner(Retrofit retrofit, AutoRestParameterGroupingTestServiceImpl client) { + this.service = retrofit.create(ParameterGroupingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ParameterGroupings to be + * used by Retrofit to perform actually REST calls. + */ + interface ParameterGroupingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureparametergrouping.ParameterGroupings postRequired" }) + @POST("parameterGrouping/postRequired/{path}") + Observable> postRequired(@Path("path") String path, @Header("accept-language") String acceptLanguage, @Body int body, @Header("customHeader") String customHeader, @Query("query") Integer query, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureparametergrouping.ParameterGroupings postOptional" }) + @POST("parameterGrouping/postOptional") + Observable> postOptional(@Header("accept-language") String acceptLanguage, @Header("customHeader") String customHeader, @Query("query") Integer query, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureparametergrouping.ParameterGroupings postMultiParamGroups" }) + @POST("parameterGrouping/postMultipleParameterGroups") + Observable> postMultiParamGroups(@Header("accept-language") String acceptLanguage, @Header("header-one") String headerOne, @Query("query-one") Integer queryOne, @Header("header-two") String headerTwo, @Query("query-two") Integer queryTwo, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureparametergrouping.ParameterGroupings postSharedParameterGroupObject" }) + @POST("parameterGrouping/sharedParameterGroupObject") + Observable> postSharedParameterGroupObject(@Header("accept-language") String acceptLanguage, @Header("header-one") String headerOne, @Query("query-one") Integer queryOne, @Header("User-Agent") String userAgent); + + } + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postRequired(ParameterGroupingPostRequiredParametersInner parameterGroupingPostRequiredParameters) { + postRequiredWithServiceResponseAsync(parameterGroupingPostRequiredParameters).toBlocking().single().body(); + } + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredAsync(ParameterGroupingPostRequiredParametersInner parameterGroupingPostRequiredParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredWithServiceResponseAsync(parameterGroupingPostRequiredParameters), serviceCallback); + } + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postRequiredAsync(ParameterGroupingPostRequiredParametersInner parameterGroupingPostRequiredParameters) { + return postRequiredWithServiceResponseAsync(parameterGroupingPostRequiredParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post a bunch of required parameters grouped. + * + * @param parameterGroupingPostRequiredParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postRequiredWithServiceResponseAsync(ParameterGroupingPostRequiredParametersInner parameterGroupingPostRequiredParameters) { + if (parameterGroupingPostRequiredParameters == null) { + throw new IllegalArgumentException("Parameter parameterGroupingPostRequiredParameters is required and cannot be null."); + } + Validator.validate(parameterGroupingPostRequiredParameters); + int body = parameterGroupingPostRequiredParameters.body(); + String customHeader = parameterGroupingPostRequiredParameters.customHeader(); + Integer query = parameterGroupingPostRequiredParameters.query(); + String path = parameterGroupingPostRequiredParameters.path(); + return service.postRequired(path, this.client.acceptLanguage(), body, customHeader, query, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptional() { + postOptionalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalAsync() { + return postOptionalWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalWithServiceResponseAsync() { + final ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters = null; + String customHeader = null; + Integer query = null; + return service.postOptional(this.client.acceptLanguage(), customHeader, query, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptional(ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters) { + postOptionalWithServiceResponseAsync(parameterGroupingPostOptionalParameters).toBlocking().single().body(); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalAsync(ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalWithServiceResponseAsync(parameterGroupingPostOptionalParameters), serviceCallback); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalAsync(ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters) { + return postOptionalWithServiceResponseAsync(parameterGroupingPostOptionalParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post a bunch of optional parameters grouped. + * + * @param parameterGroupingPostOptionalParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalWithServiceResponseAsync(ParameterGroupingPostOptionalParametersInner parameterGroupingPostOptionalParameters) { + Validator.validate(parameterGroupingPostOptionalParameters); + String customHeader = null; + if (parameterGroupingPostOptionalParameters != null) { + customHeader = parameterGroupingPostOptionalParameters.customHeader(); + } + Integer query = null; + if (parameterGroupingPostOptionalParameters != null) { + query = parameterGroupingPostOptionalParameters.query(); + } + return service.postOptional(this.client.acceptLanguage(), customHeader, query, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMultiParamGroups() { + postMultiParamGroupsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMultiParamGroupsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMultiParamGroupsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMultiParamGroupsAsync() { + return postMultiParamGroupsWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMultiParamGroupsWithServiceResponseAsync() { + final FirstParameterGroupInner firstParameterGroup = null; + final ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup = null; + String headerOne = null; + Integer queryOne = null; + String headerTwo = null; + Integer queryTwo = null; + return service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMultiParamGroupsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMultiParamGroups(FirstParameterGroupInner firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup) { + postMultiParamGroupsWithServiceResponseAsync(firstParameterGroup, parameterGroupingPostMultiParamGroupsSecondParamGroup).toBlocking().single().body(); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMultiParamGroupsAsync(FirstParameterGroupInner firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMultiParamGroupsWithServiceResponseAsync(firstParameterGroup, parameterGroupingPostMultiParamGroupsSecondParamGroup), serviceCallback); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMultiParamGroupsAsync(FirstParameterGroupInner firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup) { + return postMultiParamGroupsWithServiceResponseAsync(firstParameterGroup, parameterGroupingPostMultiParamGroupsSecondParamGroup).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post parameters from multiple different parameter groups. + * + * @param firstParameterGroup Additional parameters for the operation + * @param parameterGroupingPostMultiParamGroupsSecondParamGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMultiParamGroupsWithServiceResponseAsync(FirstParameterGroupInner firstParameterGroup, ParameterGroupingPostMultiParamGroupsSecondParamGroupInner parameterGroupingPostMultiParamGroupsSecondParamGroup) { + Validator.validate(firstParameterGroup); + Validator.validate(parameterGroupingPostMultiParamGroupsSecondParamGroup); + String headerOne = null; + if (firstParameterGroup != null) { + headerOne = firstParameterGroup.headerOne(); + } + Integer queryOne = null; + if (firstParameterGroup != null) { + queryOne = firstParameterGroup.queryOne(); + } + String headerTwo = null; + if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) { + headerTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.headerTwo(); + } + Integer queryTwo = null; + if (parameterGroupingPostMultiParamGroupsSecondParamGroup != null) { + queryTwo = parameterGroupingPostMultiParamGroupsSecondParamGroup.queryTwo(); + } + return service.postMultiParamGroups(this.client.acceptLanguage(), headerOne, queryOne, headerTwo, queryTwo, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMultiParamGroupsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMultiParamGroupsDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postSharedParameterGroupObject() { + postSharedParameterGroupObjectWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postSharedParameterGroupObjectAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postSharedParameterGroupObjectWithServiceResponseAsync(), serviceCallback); + } + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postSharedParameterGroupObjectAsync() { + return postSharedParameterGroupObjectWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post parameters with a shared parameter group object. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postSharedParameterGroupObjectWithServiceResponseAsync() { + final FirstParameterGroupInner firstParameterGroup = null; + String headerOne = null; + Integer queryOne = null; + return service.postSharedParameterGroupObject(this.client.acceptLanguage(), headerOne, queryOne, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postSharedParameterGroupObjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postSharedParameterGroupObject(FirstParameterGroupInner firstParameterGroup) { + postSharedParameterGroupObjectWithServiceResponseAsync(firstParameterGroup).toBlocking().single().body(); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postSharedParameterGroupObjectAsync(FirstParameterGroupInner firstParameterGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postSharedParameterGroupObjectWithServiceResponseAsync(firstParameterGroup), serviceCallback); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postSharedParameterGroupObjectAsync(FirstParameterGroupInner firstParameterGroup) { + return postSharedParameterGroupObjectWithServiceResponseAsync(firstParameterGroup).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post parameters with a shared parameter group object. + * + * @param firstParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postSharedParameterGroupObjectWithServiceResponseAsync(FirstParameterGroupInner firstParameterGroup) { + Validator.validate(firstParameterGroup); + String headerOne = null; + if (firstParameterGroup != null) { + headerOne = firstParameterGroup.headerOne(); + } + Integer queryOne = null; + if (firstParameterGroup != null) { + queryOne = firstParameterGroup.queryOne(); + } + return service.postSharedParameterGroupObject(this.client.acceptLanguage(), headerOne, queryOne, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postSharedParameterGroupObjectDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postSharedParameterGroupObjectDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java new file mode 100644 index 0000000000..191b184e65 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestParameterGroupingTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.azureparametergrouping.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/azureparametergrouping/package-info.java b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/package-info.java new file mode 100644 index 0000000000..e7d821411f --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureparametergrouping/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestParameterGroupingTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.azureparametergrouping; diff --git a/test/azurefluent/src/main/java/fixtures/azurereport/Error.java b/test/azurefluent/src/main/java/fixtures/azurereport/Error.java new file mode 100644 index 0000000000..8f0852a8a9 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurereport/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurereport; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurereport/ErrorException.java b/test/azurefluent/src/main/java/fixtures/azurereport/ErrorException.java new file mode 100644 index 0000000000..703fca506c --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurereport/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurereport; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java b/test/azurefluent/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java new file mode 100644 index 0000000000..0dbcfc96cb --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurereport/implementation/AutoRestReportServiceForAzureImpl.java @@ -0,0 +1,247 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurereport.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurereport.ErrorException; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the AutoRestReportServiceForAzureImpl class. + */ +public class AutoRestReportServiceForAzureImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private AutoRestReportServiceForAzureService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestReportServiceForAzureImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestReportServiceForAzureImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestReportServiceForAzureImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of AutoRestReportServiceForAzure client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestReportServiceForAzureImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestReportServiceForAzure client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestReportServiceForAzureImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestReportServiceForAzure client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestReportServiceForAzureImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestReportServiceForAzure", "1.0.0"); + } + + private void initializeService() { + service = restClient().retrofit().create(AutoRestReportServiceForAzureService.class); + } + + /** + * The interface defining all the services for AutoRestReportServiceForAzure to be + * used by Retrofit to perform actually REST calls. + */ + interface AutoRestReportServiceForAzureService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurereport.AutoRestReportServiceForAzure getReport" }) + @GET("report/azure") + Observable> getReport(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + public Map getReport() { + return getReportWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get test coverage report. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getReportAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getReportWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable> getReportAsync() { + return getReportWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable>> getReportWithServiceResponseAsync() { + return service.getReport(this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getReportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getReportDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurereport/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/azurereport/implementation/package-info.java new file mode 100644 index 0000000000..769426621a --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurereport/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestReportServiceForAzure. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurereport.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/azurereport/package-info.java b/test/azurefluent/src/main/java/fixtures/azurereport/package-info.java new file mode 100644 index 0000000000..8138a8bbc3 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurereport/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestReportServiceForAzure. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurereport; diff --git a/test/azurefluent/src/main/java/fixtures/azureresource/Error.java b/test/azurefluent/src/main/java/fixtures/azureresource/Error.java new file mode 100644 index 0000000000..2625e3ab37 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureresource/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureresource/ErrorException.java b/test/azurefluent/src/main/java/fixtures/azureresource/ErrorException.java new file mode 100644 index 0000000000..4391cdc0dd --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureresource/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/azureresource/implementation/AutoRestResourceFlatteningTestServiceImpl.java b/test/azurefluent/src/main/java/fixtures/azureresource/implementation/AutoRestResourceFlatteningTestServiceImpl.java new file mode 100644 index 0000000000..2c64350bed --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureresource/implementation/AutoRestResourceFlatteningTestServiceImpl.java @@ -0,0 +1,791 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.Resource; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.azureresource.ErrorException; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the AutoRestResourceFlatteningTestServiceImpl class. + */ +public class AutoRestResourceFlatteningTestServiceImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private AutoRestResourceFlatteningTestServiceService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestResourceFlatteningTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestResourceFlatteningTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestResourceFlatteningTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestResourceFlatteningTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestResourceFlatteningTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestResourceFlatteningTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestResourceFlatteningTestService", "1.0.0"); + } + + private void initializeService() { + service = restClient().retrofit().create(AutoRestResourceFlatteningTestServiceService.class); + } + + /** + * The interface defining all the services for AutoRestResourceFlatteningTestService to be + * used by Retrofit to perform actually REST calls. + */ + interface AutoRestResourceFlatteningTestServiceService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService putArray" }) + @PUT("azure/resource-flatten/array") + Observable> putArray(@Body List resourceArray, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService getArray" }) + @GET("azure/resource-flatten/array") + Observable> getArray(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService putDictionary" }) + @PUT("azure/resource-flatten/dictionary") + Observable> putDictionary(@Body Map resourceDictionary, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService getDictionary" }) + @GET("azure/resource-flatten/dictionary") + Observable> getDictionary(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService putResourceCollection" }) + @PUT("azure/resource-flatten/resourcecollection") + Observable> putResourceCollection(@Body ResourceCollectionInner resourceComplexObject, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azureresource.AutoRestResourceFlatteningTestService getResourceCollection" }) + @GET("azure/resource-flatten/resourcecollection") + Observable> getResourceCollection(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putArray() { + putArrayWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putArrayAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putArrayWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putArrayAsync() { + return putArrayWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putArrayWithServiceResponseAsync() { + final List resourceArray = null; + return service.putArray(resourceArray, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putArray(List resourceArray) { + putArrayWithServiceResponseAsync(resourceArray).toBlocking().single().body(); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putArrayAsync(List resourceArray, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putArrayWithServiceResponseAsync(resourceArray), serviceCallback); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putArrayAsync(List resourceArray) { + return putArrayWithServiceResponseAsync(resourceArray).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putArrayWithServiceResponseAsync(List resourceArray) { + Validator.validate(resourceArray); + return service.putArray(resourceArray, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putArrayDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FlattenedProductInner> object if successful. + */ + public List getArray() { + return getArrayWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getArrayAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getArrayWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProductInner> object + */ + public Observable> getArrayAsync() { + return getArrayWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProductInner> object + */ + public Observable>> getArrayWithServiceResponseAsync() { + return service.getArray(this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getArrayDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDictionary() { + putDictionaryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDictionaryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDictionaryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDictionaryAsync() { + return putDictionaryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDictionaryWithServiceResponseAsync() { + final Map resourceDictionary = null; + return service.putDictionary(resourceDictionary, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDictionary(Map resourceDictionary) { + putDictionaryWithServiceResponseAsync(resourceDictionary).toBlocking().single().body(); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDictionaryAsync(Map resourceDictionary, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDictionaryWithServiceResponseAsync(resourceDictionary), serviceCallback); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDictionaryAsync(Map resourceDictionary) { + return putDictionaryWithServiceResponseAsync(resourceDictionary).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDictionaryWithServiceResponseAsync(Map resourceDictionary) { + Validator.validate(resourceDictionary); + return service.putDictionary(resourceDictionary, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDictionaryDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, FlattenedProductInner> object if successful. + */ + public Map getDictionary() { + return getDictionaryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDictionaryAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProductInner> object + */ + public Observable> getDictionaryAsync() { + return getDictionaryWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProductInner> object + */ + public Observable>> getDictionaryWithServiceResponseAsync() { + return service.getDictionary(this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDictionaryDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putResourceCollection() { + putResourceCollectionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putResourceCollectionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putResourceCollectionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putResourceCollectionAsync() { + return putResourceCollectionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putResourceCollectionWithServiceResponseAsync() { + final ResourceCollectionInner resourceComplexObject = null; + return service.putResourceCollection(resourceComplexObject, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putResourceCollection(ResourceCollectionInner resourceComplexObject) { + putResourceCollectionWithServiceResponseAsync(resourceComplexObject).toBlocking().single().body(); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putResourceCollectionAsync(ResourceCollectionInner resourceComplexObject, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putResourceCollectionWithServiceResponseAsync(resourceComplexObject), serviceCallback); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putResourceCollectionAsync(ResourceCollectionInner resourceComplexObject) { + return putResourceCollectionWithServiceResponseAsync(resourceComplexObject).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putResourceCollectionWithServiceResponseAsync(ResourceCollectionInner resourceComplexObject) { + Validator.validate(resourceComplexObject); + return service.putResourceCollection(resourceComplexObject, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putResourceCollectionDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceCollectionInner object if successful. + */ + public ResourceCollectionInner getResourceCollection() { + return getResourceCollectionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getResourceCollectionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getResourceCollectionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollectionInner object + */ + public Observable getResourceCollectionAsync() { + return getResourceCollectionWithServiceResponseAsync().map(new Func1, ResourceCollectionInner>() { + @Override + public ResourceCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollectionInner object + */ + public Observable> getResourceCollectionWithServiceResponseAsync() { + return service.getResourceCollection(this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getResourceCollectionDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureresource/implementation/FlattenedProductInner.java b/test/azurefluent/src/main/java/fixtures/azureresource/implementation/FlattenedProductInner.java new file mode 100644 index 0000000000..b7545be2da --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureresource/implementation/FlattenedProductInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The FlattenedProductInner model. + */ +@JsonFlatten +public class FlattenedProductInner extends Resource { + /** + * The pname property. + */ + @JsonProperty(value = "properties.pname") + private String pname; + + /** + * The lsize property. + */ + @JsonProperty(value = "properties.lsize") + private Integer lsize; + + /** + * The provisioningState property. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Get the pname value. + * + * @return the pname value + */ + public String pname() { + return this.pname; + } + + /** + * Set the pname value. + * + * @param pname the pname value to set + * @return the FlattenedProductInner object itself. + */ + public FlattenedProductInner withPname(String pname) { + this.pname = pname; + return this; + } + + /** + * Get the lsize value. + * + * @return the lsize value + */ + public Integer lsize() { + return this.lsize; + } + + /** + * Set the lsize value. + * + * @param lsize the lsize value to set + * @return the FlattenedProductInner object itself. + */ + public FlattenedProductInner withLsize(Integer lsize) { + this.lsize = lsize; + return this; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the FlattenedProductInner object itself. + */ + public FlattenedProductInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureresource/implementation/ResourceCollectionInner.java b/test/azurefluent/src/main/java/fixtures/azureresource/implementation/ResourceCollectionInner.java new file mode 100644 index 0000000000..555c78e613 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureresource/implementation/ResourceCollectionInner.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azureresource.implementation; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceCollectionInner model. + */ +public class ResourceCollectionInner { + /** + * The productresource property. + */ + @JsonProperty(value = "productresource") + private FlattenedProductInner productresource; + + /** + * The arrayofresources property. + */ + @JsonProperty(value = "arrayofresources") + private List arrayofresources; + + /** + * The dictionaryofresources property. + */ + @JsonProperty(value = "dictionaryofresources") + private Map dictionaryofresources; + + /** + * Get the productresource value. + * + * @return the productresource value + */ + public FlattenedProductInner productresource() { + return this.productresource; + } + + /** + * Set the productresource value. + * + * @param productresource the productresource value to set + * @return the ResourceCollectionInner object itself. + */ + public ResourceCollectionInner withProductresource(FlattenedProductInner productresource) { + this.productresource = productresource; + return this; + } + + /** + * Get the arrayofresources value. + * + * @return the arrayofresources value + */ + public List arrayofresources() { + return this.arrayofresources; + } + + /** + * Set the arrayofresources value. + * + * @param arrayofresources the arrayofresources value to set + * @return the ResourceCollectionInner object itself. + */ + public ResourceCollectionInner withArrayofresources(List arrayofresources) { + this.arrayofresources = arrayofresources; + return this; + } + + /** + * Get the dictionaryofresources value. + * + * @return the dictionaryofresources value + */ + public Map dictionaryofresources() { + return this.dictionaryofresources; + } + + /** + * Set the dictionaryofresources value. + * + * @param dictionaryofresources the dictionaryofresources value to set + * @return the ResourceCollectionInner object itself. + */ + public ResourceCollectionInner withDictionaryofresources(Map dictionaryofresources) { + this.dictionaryofresources = dictionaryofresources; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azureresource/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/azureresource/implementation/package-info.java new file mode 100644 index 0000000000..941141e066 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureresource/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestResourceFlatteningTestService. + * Resource Flattening for AutoRest. + */ +package fixtures.azureresource.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/azureresource/package-info.java b/test/azurefluent/src/main/java/fixtures/azureresource/package-info.java new file mode 100644 index 0000000000..177aec70ce --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azureresource/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestResourceFlatteningTestService. + * Resource Flattening for AutoRest. + */ +package fixtures.azureresource; diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/Error.java b/test/azurefluent/src/main/java/fixtures/azurespecials/Error.java new file mode 100644 index 0000000000..8b48e32085 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/Error.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The constantId property. + */ + @JsonProperty(value = "constantId") + private Integer constantId; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the constantId value. + * + * @return the constantId value + */ + public Integer constantId() { + return this.constantId; + } + + /** + * Set the constantId value. + * + * @param constantId the constantId value to set + * @return the Error object itself. + */ + public Error withConstantId(Integer constantId) { + this.constantId = constantId; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/ErrorException.java b/test/azurefluent/src/main/java/fixtures/azurespecials/ErrorException.java new file mode 100644 index 0000000000..6990b6b597 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/OdataFilter.java b/test/azurefluent/src/main/java/fixtures/azurespecials/OdataFilter.java new file mode 100644 index 0000000000..8f132123e8 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/OdataFilter.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OdataFilter model. + */ +public class OdataFilter { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the OdataFilter object itself. + */ + public OdataFilter withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the OdataFilter object itself. + */ + public OdataFilter withName(String name) { + this.name = name; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/ApiVersionDefaultsInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/ApiVersionDefaultsInner.java new file mode 100644 index 0000000000..1e2eaecf2b --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/ApiVersionDefaultsInner.java @@ -0,0 +1,345 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApiVersionDefaults. + */ +public class ApiVersionDefaultsInner { + /** The Retrofit service to perform REST calls. */ + private ApiVersionDefaultsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of ApiVersionDefaultsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApiVersionDefaultsInner(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(ApiVersionDefaultsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApiVersionDefaults to be + * used by Retrofit to perform actually REST calls. + */ + interface ApiVersionDefaultsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionDefaults getMethodGlobalValid" }) + @GET("azurespecials/apiVersion/method/string/none/query/global/2015-07-01-preview") + Observable> getMethodGlobalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionDefaults getMethodGlobalNotProvidedValid" }) + @GET("azurespecials/apiVersion/method/string/none/query/globalNotProvided/2015-07-01-preview") + Observable> getMethodGlobalNotProvidedValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionDefaults getPathGlobalValid" }) + @GET("azurespecials/apiVersion/path/string/none/query/global/2015-07-01-preview") + Observable> getPathGlobalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionDefaults getSwaggerGlobalValid" }) + @GET("azurespecials/apiVersion/swagger/string/none/query/global/2015-07-01-preview") + Observable> getSwaggerGlobalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodGlobalValid() { + getMethodGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodGlobalValidAsync() { + return getMethodGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodGlobalValidWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMethodGlobalValid(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodGlobalNotProvidedValid() { + getMethodGlobalNotProvidedValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodGlobalNotProvidedValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodGlobalNotProvidedValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodGlobalNotProvidedValidAsync() { + return getMethodGlobalNotProvidedValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodGlobalNotProvidedValidWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getMethodGlobalNotProvidedValid(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodGlobalNotProvidedValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodGlobalNotProvidedValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getPathGlobalValid() { + getPathGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPathGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPathGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getPathGlobalValidAsync() { + return getPathGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getPathGlobalValidWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getPathGlobalValid(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPathGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPathGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getSwaggerGlobalValid() { + getSwaggerGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * GET method with api-version modeled in global settings. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSwaggerGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSwaggerGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getSwaggerGlobalValidAsync() { + return getSwaggerGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * GET method with api-version modeled in global settings. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getSwaggerGlobalValidWithServiceResponseAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getSwaggerGlobalValid(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSwaggerGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSwaggerGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/ApiVersionLocalsInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/ApiVersionLocalsInner.java new file mode 100644 index 0000000000..e29b6f745b --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/ApiVersionLocalsInner.java @@ -0,0 +1,399 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ApiVersionLocals. + */ +public class ApiVersionLocalsInner { + /** The Retrofit service to perform REST calls. */ + private ApiVersionLocalsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of ApiVersionLocalsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ApiVersionLocalsInner(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(ApiVersionLocalsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ApiVersionLocals to be + * used by Retrofit to perform actually REST calls. + */ + interface ApiVersionLocalsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionLocals getMethodLocalValid" }) + @GET("azurespecials/apiVersion/method/string/none/query/local/2.0") + Observable> getMethodLocalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionLocals getMethodLocalNull" }) + @GET("azurespecials/apiVersion/method/string/none/query/local/null") + Observable> getMethodLocalNull(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionLocals getPathLocalValid" }) + @GET("azurespecials/apiVersion/path/string/none/query/local/2.0") + Observable> getPathLocalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.ApiVersionLocals getSwaggerLocalValid" }) + @GET("azurespecials/apiVersion/swagger/string/none/query/local/2.0") + Observable> getSwaggerLocalValid(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodLocalValid() { + getMethodLocalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodLocalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodLocalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodLocalValidAsync() { + return getMethodLocalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodLocalValidWithServiceResponseAsync() { + final String apiVersion = "2.0"; + return service.getMethodLocalValid(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodLocalValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodLocalNull() { + getMethodLocalNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodLocalNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodLocalNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodLocalNullAsync() { + return getMethodLocalNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodLocalNullWithServiceResponseAsync() { + final String apiVersion = null; + return service.getMethodLocalNull(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodLocalNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodLocalNull(String apiVersion) { + getMethodLocalNullWithServiceResponseAsync(apiVersion).toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodLocalNullAsync(String apiVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodLocalNullWithServiceResponseAsync(apiVersion), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodLocalNullAsync(String apiVersion) { + return getMethodLocalNullWithServiceResponseAsync(apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = null to succeed. + * + * @param apiVersion This should appear as a method parameter, use value null, this should result in no serialized parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodLocalNullWithServiceResponseAsync(String apiVersion) { + return service.getMethodLocalNull(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodLocalNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodLocalNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getPathLocalValid() { + getPathLocalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPathLocalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPathLocalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getPathLocalValidAsync() { + return getPathLocalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getPathLocalValidWithServiceResponseAsync() { + final String apiVersion = "2.0"; + return service.getPathLocalValid(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPathLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPathLocalValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getSwaggerLocalValid() { + getSwaggerLocalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSwaggerLocalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSwaggerLocalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getSwaggerLocalValidAsync() { + return getSwaggerLocalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with api-version modeled in the method. pass in api-version = '2.0' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getSwaggerLocalValidWithServiceResponseAsync() { + final String apiVersion = "2.0"; + return service.getSwaggerLocalValid(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSwaggerLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSwaggerLocalValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/AutoRestAzureSpecialParametersTestClientImpl.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/AutoRestAzureSpecialParametersTestClientImpl.java new file mode 100644 index 0000000000..b40aa1bbea --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/AutoRestAzureSpecialParametersTestClientImpl.java @@ -0,0 +1,296 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AutoRestAzureSpecialParametersTestClientImpl class. + */ +public class AutoRestAzureSpecialParametersTestClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'. */ + private String subscriptionId; + + /** + * Gets The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription id, which appears in the path, always modeled in credentials. The value is always '1234-5678-9012-3456'. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AutoRestAzureSpecialParametersTestClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The api version, which appears in the query, the value is always '2015-07-01-preview'. */ + private String apiVersion; + + /** + * Gets The api version, which appears in the query, the value is always '2015-07-01-preview'. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestAzureSpecialParametersTestClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestAzureSpecialParametersTestClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestAzureSpecialParametersTestClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The XMsClientRequestIdsInner object to access its operations. + */ + private XMsClientRequestIdsInner xMsClientRequestIds; + + /** + * Gets the XMsClientRequestIdsInner object to access its operations. + * @return the XMsClientRequestIdsInner object. + */ + public XMsClientRequestIdsInner xMsClientRequestIds() { + return this.xMsClientRequestIds; + } + + /** + * The SubscriptionInCredentialsInner object to access its operations. + */ + private SubscriptionInCredentialsInner subscriptionInCredentials; + + /** + * Gets the SubscriptionInCredentialsInner object to access its operations. + * @return the SubscriptionInCredentialsInner object. + */ + public SubscriptionInCredentialsInner subscriptionInCredentials() { + return this.subscriptionInCredentials; + } + + /** + * The SubscriptionInMethodsInner object to access its operations. + */ + private SubscriptionInMethodsInner subscriptionInMethods; + + /** + * Gets the SubscriptionInMethodsInner object to access its operations. + * @return the SubscriptionInMethodsInner object. + */ + public SubscriptionInMethodsInner subscriptionInMethods() { + return this.subscriptionInMethods; + } + + /** + * The ApiVersionDefaultsInner object to access its operations. + */ + private ApiVersionDefaultsInner apiVersionDefaults; + + /** + * Gets the ApiVersionDefaultsInner object to access its operations. + * @return the ApiVersionDefaultsInner object. + */ + public ApiVersionDefaultsInner apiVersionDefaults() { + return this.apiVersionDefaults; + } + + /** + * The ApiVersionLocalsInner object to access its operations. + */ + private ApiVersionLocalsInner apiVersionLocals; + + /** + * Gets the ApiVersionLocalsInner object to access its operations. + * @return the ApiVersionLocalsInner object. + */ + public ApiVersionLocalsInner apiVersionLocals() { + return this.apiVersionLocals; + } + + /** + * The SkipUrlEncodingsInner object to access its operations. + */ + private SkipUrlEncodingsInner skipUrlEncodings; + + /** + * Gets the SkipUrlEncodingsInner object to access its operations. + * @return the SkipUrlEncodingsInner object. + */ + public SkipUrlEncodingsInner skipUrlEncodings() { + return this.skipUrlEncodings; + } + + /** + * The OdatasInner object to access its operations. + */ + private OdatasInner odatas; + + /** + * Gets the OdatasInner object to access its operations. + * @return the OdatasInner object. + */ + public OdatasInner odatas() { + return this.odatas; + } + + /** + * The HeadersInner object to access its operations. + */ + private HeadersInner headers; + + /** + * Gets the HeadersInner object to access its operations. + * @return the HeadersInner object. + */ + public HeadersInner headers() { + return this.headers; + } + + /** + * Initializes an instance of AutoRestAzureSpecialParametersTestClient client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestAzureSpecialParametersTestClientImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestAzureSpecialParametersTestClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestAzureSpecialParametersTestClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestAzureSpecialParametersTestClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestAzureSpecialParametersTestClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2015-07-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.xMsClientRequestIds = new XMsClientRequestIdsInner(restClient().retrofit(), this); + this.subscriptionInCredentials = new SubscriptionInCredentialsInner(restClient().retrofit(), this); + this.subscriptionInMethods = new SubscriptionInMethodsInner(restClient().retrofit(), this); + this.apiVersionDefaults = new ApiVersionDefaultsInner(restClient().retrofit(), this); + this.apiVersionLocals = new ApiVersionLocalsInner(restClient().retrofit(), this); + this.skipUrlEncodings = new SkipUrlEncodingsInner(restClient().retrofit(), this); + this.odatas = new OdatasInner(restClient().retrofit(), this); + this.headers = new HeadersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestAzureSpecialParametersTestClient", "2015-07-01-preview"); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdHeadHeadersInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdHeadHeadersInner.java new file mode 100644 index 0000000000..d87bb74446 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdHeadHeadersInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for customNamedRequestIdHead operation. + */ +public class HeaderCustomNamedRequestIdHeadHeadersInner { + /** + * Gets the foo-request-id. + */ + @JsonProperty(value = "foo-request-id") + private String fooRequestId; + + /** + * Get the fooRequestId value. + * + * @return the fooRequestId value + */ + public String fooRequestId() { + return this.fooRequestId; + } + + /** + * Set the fooRequestId value. + * + * @param fooRequestId the fooRequestId value to set + * @return the HeaderCustomNamedRequestIdHeadHeadersInner object itself. + */ + public HeaderCustomNamedRequestIdHeadHeadersInner withFooRequestId(String fooRequestId) { + this.fooRequestId = fooRequestId; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdHeadersInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdHeadersInner.java new file mode 100644 index 0000000000..80843b294f --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdHeadersInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for customNamedRequestId operation. + */ +public class HeaderCustomNamedRequestIdHeadersInner { + /** + * Gets the foo-request-id. + */ + @JsonProperty(value = "foo-request-id") + private String fooRequestId; + + /** + * Get the fooRequestId value. + * + * @return the fooRequestId value + */ + public String fooRequestId() { + return this.fooRequestId; + } + + /** + * Set the fooRequestId value. + * + * @param fooRequestId the fooRequestId value to set + * @return the HeaderCustomNamedRequestIdHeadersInner object itself. + */ + public HeaderCustomNamedRequestIdHeadersInner withFooRequestId(String fooRequestId) { + this.fooRequestId = fooRequestId; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdParamGroupingHeadersInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdParamGroupingHeadersInner.java new file mode 100644 index 0000000000..53b2834d5a --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdParamGroupingHeadersInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for customNamedRequestIdParamGrouping operation. + */ +public class HeaderCustomNamedRequestIdParamGroupingHeadersInner { + /** + * Gets the foo-request-id. + */ + @JsonProperty(value = "foo-request-id") + private String fooRequestId; + + /** + * Get the fooRequestId value. + * + * @return the fooRequestId value + */ + public String fooRequestId() { + return this.fooRequestId; + } + + /** + * Set the fooRequestId value. + * + * @param fooRequestId the fooRequestId value to set + * @return the HeaderCustomNamedRequestIdParamGroupingHeadersInner object itself. + */ + public HeaderCustomNamedRequestIdParamGroupingHeadersInner withFooRequestId(String fooRequestId) { + this.fooRequestId = fooRequestId; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdParamGroupingParametersInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdParamGroupingParametersInner.java new file mode 100644 index 0000000000..8b4996f04b --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeaderCustomNamedRequestIdParamGroupingParametersInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for customNamedRequestIdParamGrouping operation. + */ +public class HeaderCustomNamedRequestIdParamGroupingParametersInner { + /** + * The fooRequestId. + */ + @JsonProperty(value = "", required = true) + private String fooClientRequestId; + + /** + * Get the fooClientRequestId value. + * + * @return the fooClientRequestId value + */ + public String fooClientRequestId() { + return this.fooClientRequestId; + } + + /** + * Set the fooClientRequestId value. + * + * @param fooClientRequestId the fooClientRequestId value to set + * @return the HeaderCustomNamedRequestIdParamGroupingParametersInner object itself. + */ + public HeaderCustomNamedRequestIdParamGroupingParametersInner withFooClientRequestId(String fooClientRequestId) { + this.fooClientRequestId = fooClientRequestId; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeadersInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeadersInner.java new file mode 100644 index 0000000000..7ad2e9a062 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/HeadersInner.java @@ -0,0 +1,290 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import fixtures.azurespecials.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.HEAD; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Headers. + */ +public class HeadersInner { + /** The Retrofit service to perform REST calls. */ + private HeadersService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of HeadersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HeadersInner(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(HeadersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Headers to be + * used by Retrofit to perform actually REST calls. + */ + interface HeadersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.Headers customNamedRequestId" }) + @POST("azurespecials/customNamedRequestId") + Observable> customNamedRequestId(@Header("foo-client-request-id") String fooClientRequestId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.Headers customNamedRequestIdParamGrouping" }) + @POST("azurespecials/customNamedRequestIdParamGrouping") + Observable> customNamedRequestIdParamGrouping(@Header("accept-language") String acceptLanguage, @Header("foo-client-request-id") String fooClientRequestId, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.Headers customNamedRequestIdHead" }) + @HEAD("azurespecials/customNamedRequestIdHead") + Observable> customNamedRequestIdHead(@Header("foo-client-request-id") String fooClientRequestId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void customNamedRequestId(String fooClientRequestId) { + customNamedRequestIdWithServiceResponseAsync(fooClientRequestId).toBlocking().single().body(); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture customNamedRequestIdAsync(String fooClientRequestId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(customNamedRequestIdWithServiceResponseAsync(fooClientRequestId), serviceCallback); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable customNamedRequestIdAsync(String fooClientRequestId) { + return customNamedRequestIdWithServiceResponseAsync(fooClientRequestId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> customNamedRequestIdWithServiceResponseAsync(String fooClientRequestId) { + if (fooClientRequestId == null) { + throw new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null."); + } + return service.customNamedRequestId(fooClientRequestId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = customNamedRequestIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders customNamedRequestIdDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderCustomNamedRequestIdHeadersInner.class); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void customNamedRequestIdParamGrouping(HeaderCustomNamedRequestIdParamGroupingParametersInner headerCustomNamedRequestIdParamGroupingParameters) { + customNamedRequestIdParamGroupingWithServiceResponseAsync(headerCustomNamedRequestIdParamGroupingParameters).toBlocking().single().body(); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture customNamedRequestIdParamGroupingAsync(HeaderCustomNamedRequestIdParamGroupingParametersInner headerCustomNamedRequestIdParamGroupingParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(customNamedRequestIdParamGroupingWithServiceResponseAsync(headerCustomNamedRequestIdParamGroupingParameters), serviceCallback); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable customNamedRequestIdParamGroupingAsync(HeaderCustomNamedRequestIdParamGroupingParametersInner headerCustomNamedRequestIdParamGroupingParameters) { + return customNamedRequestIdParamGroupingWithServiceResponseAsync(headerCustomNamedRequestIdParamGroupingParameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request, via a parameter group. + * + * @param headerCustomNamedRequestIdParamGroupingParameters Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> customNamedRequestIdParamGroupingWithServiceResponseAsync(HeaderCustomNamedRequestIdParamGroupingParametersInner headerCustomNamedRequestIdParamGroupingParameters) { + if (headerCustomNamedRequestIdParamGroupingParameters == null) { + throw new IllegalArgumentException("Parameter headerCustomNamedRequestIdParamGroupingParameters is required and cannot be null."); + } + Validator.validate(headerCustomNamedRequestIdParamGroupingParameters); + String fooClientRequestId = headerCustomNamedRequestIdParamGroupingParameters.fooClientRequestId(); + return service.customNamedRequestIdParamGrouping(this.client.acceptLanguage(), fooClientRequestId, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = customNamedRequestIdParamGroupingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders customNamedRequestIdParamGroupingDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderCustomNamedRequestIdParamGroupingHeadersInner.class); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean customNamedRequestIdHead(String fooClientRequestId) { + return customNamedRequestIdHeadWithServiceResponseAsync(fooClientRequestId).toBlocking().single().body(); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture customNamedRequestIdHeadAsync(String fooClientRequestId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(customNamedRequestIdHeadWithServiceResponseAsync(fooClientRequestId), serviceCallback); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable customNamedRequestIdHeadAsync(String fooClientRequestId) { + return customNamedRequestIdHeadWithServiceResponseAsync(fooClientRequestId).map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Send foo-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param fooClientRequestId The fooRequestId + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> customNamedRequestIdHeadWithServiceResponseAsync(String fooClientRequestId) { + if (fooClientRequestId == null) { + throw new IllegalArgumentException("Parameter fooClientRequestId is required and cannot be null."); + } + return service.customNamedRequestIdHead(fooClientRequestId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = customNamedRequestIdHeadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders customNamedRequestIdHeadDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmptyWithHeaders(response, HeaderCustomNamedRequestIdHeadHeadersInner.class); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/OdatasInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/OdatasInner.java new file mode 100644 index 0000000000..1c9e028e3d --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/OdatasInner.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Odatas. + */ +public class OdatasInner { + /** The Retrofit service to perform REST calls. */ + private OdatasService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of OdatasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OdatasInner(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(OdatasService.class); + this.client = client; + } + + /** + * The interface defining all the services for Odatas to be + * used by Retrofit to perform actually REST calls. + */ + interface OdatasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.Odatas getWithFilter" }) + @GET("azurespecials/odata/filter") + Observable> getWithFilter(@Query("$filter") String filter, @Query("$top") Integer top, @Query("$orderby") String orderby, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getWithFilter() { + getWithFilterWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getWithFilterAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithFilterWithServiceResponseAsync(), serviceCallback); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getWithFilterAsync() { + return getWithFilterWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithFilterWithServiceResponseAsync() { + final String filter = null; + final Integer top = null; + final String orderby = null; + return service.getWithFilter(filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getWithFilterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getWithFilter(String filter, Integer top, String orderby) { + getWithFilterWithServiceResponseAsync(filter, top, orderby).toBlocking().single().body(); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getWithFilterAsync(String filter, Integer top, String orderby, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithFilterWithServiceResponseAsync(filter, top, orderby), serviceCallback); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getWithFilterAsync(String filter, Integer top, String orderby) { + return getWithFilterWithServiceResponseAsync(filter, top, orderby).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Specify filter parameter with value '$filter=id gt 5 and name eq 'foo'&$orderby=id&$top=10'. + * + * @param filter The filter parameter with value '$filter=id gt 5 and name eq 'foo''. + * @param top The top parameter with value 10. + * @param orderby The orderby parameter with value id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithFilterWithServiceResponseAsync(String filter, Integer top, String orderby) { + return service.getWithFilter(filter, top, orderby, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getWithFilterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getWithFilterDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SkipUrlEncodingsInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SkipUrlEncodingsInner.java new file mode 100644 index 0000000000..1295a46f44 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SkipUrlEncodingsInner.java @@ -0,0 +1,634 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SkipUrlEncodings. + */ +public class SkipUrlEncodingsInner { + /** The Retrofit service to perform REST calls. */ + private SkipUrlEncodingsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of SkipUrlEncodingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SkipUrlEncodingsInner(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(SkipUrlEncodingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SkipUrlEncodings to be + * used by Retrofit to perform actually REST calls. + */ + interface SkipUrlEncodingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getMethodPathValid" }) + @GET("azurespecials/skipUrlEncoding/method/path/valid/{unencodedPathParam}") + Observable> getMethodPathValid(@Path(value = "unencodedPathParam", encoded = true) String unencodedPathParam, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getPathPathValid" }) + @GET("azurespecials/skipUrlEncoding/path/path/valid/{unencodedPathParam}") + Observable> getPathPathValid(@Path(value = "unencodedPathParam", encoded = true) String unencodedPathParam, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getSwaggerPathValid" }) + @GET("azurespecials/skipUrlEncoding/swagger/path/valid/{unencodedPathParam}") + Observable> getSwaggerPathValid(@Path(value = "unencodedPathParam", encoded = true) String unencodedPathParam, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getMethodQueryValid" }) + @GET("azurespecials/skipUrlEncoding/method/query/valid") + Observable> getMethodQueryValid(@Query(value = "q1", encoded = true) String q1, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getMethodQueryNull" }) + @GET("azurespecials/skipUrlEncoding/method/query/null") + Observable> getMethodQueryNull(@Query(value = "q1", encoded = true) String q1, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getPathQueryValid" }) + @GET("azurespecials/skipUrlEncoding/path/query/valid") + Observable> getPathQueryValid(@Query(value = "q1", encoded = true) String q1, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SkipUrlEncodings getSwaggerQueryValid" }) + @GET("azurespecials/skipUrlEncoding/swagger/query/valid") + Observable> getSwaggerQueryValid(@Query(value = "q1", encoded = true) String q1, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodPathValid(String unencodedPathParam) { + getMethodPathValidWithServiceResponseAsync(unencodedPathParam).toBlocking().single().body(); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodPathValidAsync(String unencodedPathParam, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodPathValidWithServiceResponseAsync(unencodedPathParam), serviceCallback); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodPathValidAsync(String unencodedPathParam) { + return getMethodPathValidWithServiceResponseAsync(unencodedPathParam).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodPathValidWithServiceResponseAsync(String unencodedPathParam) { + if (unencodedPathParam == null) { + throw new IllegalArgumentException("Parameter unencodedPathParam is required and cannot be null."); + } + return service.getMethodPathValid(unencodedPathParam, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodPathValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodPathValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getPathPathValid(String unencodedPathParam) { + getPathPathValidWithServiceResponseAsync(unencodedPathParam).toBlocking().single().body(); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPathPathValidAsync(String unencodedPathParam, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPathPathValidWithServiceResponseAsync(unencodedPathParam), serviceCallback); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getPathPathValidAsync(String unencodedPathParam) { + return getPathPathValidWithServiceResponseAsync(unencodedPathParam).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param unencodedPathParam Unencoded path parameter with value 'path1/path2/path3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getPathPathValidWithServiceResponseAsync(String unencodedPathParam) { + if (unencodedPathParam == null) { + throw new IllegalArgumentException("Parameter unencodedPathParam is required and cannot be null."); + } + return service.getPathPathValid(unencodedPathParam, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPathPathValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPathPathValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getSwaggerPathValid() { + getSwaggerPathValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSwaggerPathValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSwaggerPathValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getSwaggerPathValidAsync() { + return getSwaggerPathValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded path parameter with value 'path1/path2/path3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getSwaggerPathValidWithServiceResponseAsync() { + final String unencodedPathParam = "path1/path2/path3"; + return service.getSwaggerPathValid(unencodedPathParam, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSwaggerPathValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSwaggerPathValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodQueryValid(String q1) { + getMethodQueryValidWithServiceResponseAsync(q1).toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodQueryValidAsync(String q1, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodQueryValidWithServiceResponseAsync(q1), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodQueryValidAsync(String q1) { + return getMethodQueryValidWithServiceResponseAsync(q1).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodQueryValidWithServiceResponseAsync(String q1) { + if (q1 == null) { + throw new IllegalArgumentException("Parameter q1 is required and cannot be null."); + } + return service.getMethodQueryValid(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodQueryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodQueryValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodQueryNull() { + getMethodQueryNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodQueryNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodQueryNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodQueryNullAsync() { + return getMethodQueryNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodQueryNullWithServiceResponseAsync() { + final String q1 = null; + return service.getMethodQueryNull(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getMethodQueryNull(String q1) { + getMethodQueryNullWithServiceResponseAsync(q1).toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMethodQueryNullAsync(String q1, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMethodQueryNullWithServiceResponseAsync(q1), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getMethodQueryNullAsync(String q1) { + return getMethodQueryNullWithServiceResponseAsync(q1).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value null. + * + * @param q1 Unencoded query parameter with value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getMethodQueryNullWithServiceResponseAsync(String q1) { + return service.getMethodQueryNull(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMethodQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMethodQueryNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getPathQueryValid(String q1) { + getPathQueryValidWithServiceResponseAsync(q1).toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPathQueryValidAsync(String q1, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPathQueryValidWithServiceResponseAsync(q1), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getPathQueryValidAsync(String q1) { + return getPathQueryValidWithServiceResponseAsync(q1).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param q1 Unencoded query parameter with value 'value1&q2=value2&q3=value3' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getPathQueryValidWithServiceResponseAsync(String q1) { + if (q1 == null) { + throw new IllegalArgumentException("Parameter q1 is required and cannot be null."); + } + return service.getPathQueryValid(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPathQueryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPathQueryValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getSwaggerQueryValid() { + getSwaggerQueryValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSwaggerQueryValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSwaggerQueryValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getSwaggerQueryValidAsync() { + return getSwaggerQueryValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method with unencoded query parameter with value 'value1&q2=value2&q3=value3'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getSwaggerQueryValidWithServiceResponseAsync() { + final String q1 = "value1&q2=value2&q3=value3"; + return service.getSwaggerQueryValid(q1, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSwaggerQueryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSwaggerQueryValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SubscriptionInCredentialsInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SubscriptionInCredentialsInner.java new file mode 100644 index 0000000000..4547301fbc --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SubscriptionInCredentialsInner.java @@ -0,0 +1,421 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SubscriptionInCredentials. + */ +public class SubscriptionInCredentialsInner { + /** The Retrofit service to perform REST calls. */ + private SubscriptionInCredentialsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of SubscriptionInCredentialsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubscriptionInCredentialsInner(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(SubscriptionInCredentialsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SubscriptionInCredentials to be + * used by Retrofit to perform actually REST calls. + */ + interface SubscriptionInCredentialsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postMethodGlobalValid" }) + @POST("azurespecials/subscriptionId/method/string/none/path/global/1234-5678-9012-3456/{subscriptionId}") + Observable> postMethodGlobalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postMethodGlobalNull" }) + @POST("azurespecials/subscriptionId/method/string/none/path/global/null/{subscriptionId}") + Observable> postMethodGlobalNull(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postMethodGlobalNotProvidedValid" }) + @POST("azurespecials/subscriptionId/method/string/none/path/globalNotProvided/1234-5678-9012-3456/{subscriptionId}") + Observable> postMethodGlobalNotProvidedValid(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postPathGlobalValid" }) + @POST("azurespecials/subscriptionId/path/string/none/path/global/1234-5678-9012-3456/{subscriptionId}") + Observable> postPathGlobalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInCredentials postSwaggerGlobalValid" }) + @POST("azurespecials/subscriptionId/swagger/string/none/path/global/1234-5678-9012-3456/{subscriptionId}") + Observable> postSwaggerGlobalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodGlobalValid() { + postMethodGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodGlobalValidAsync() { + return postMethodGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodGlobalValidWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.postMethodGlobalValid(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodGlobalNull() { + postMethodGlobalNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodGlobalNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodGlobalNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodGlobalNullAsync() { + return postMethodGlobalNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to null, and client-side validation should prevent you from making this call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodGlobalNullWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.postMethodGlobalNull(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodGlobalNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodGlobalNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodGlobalNotProvidedValid() { + postMethodGlobalNotProvidedValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodGlobalNotProvidedValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodGlobalNotProvidedValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodGlobalNotProvidedValidAsync() { + return postMethodGlobalNotProvidedValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodGlobalNotProvidedValidWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.postMethodGlobalNotProvidedValid(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodGlobalNotProvidedValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodGlobalNotProvidedValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postPathGlobalValid() { + postPathGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postPathGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postPathGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postPathGlobalValidAsync() { + return postPathGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postPathGlobalValidWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.postPathGlobalValid(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postPathGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postPathGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postSwaggerGlobalValid() { + postSwaggerGlobalValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postSwaggerGlobalValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postSwaggerGlobalValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postSwaggerGlobalValidAsync() { + return postSwaggerGlobalValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in credentials. Set the credential subscriptionId to '1234-5678-9012-3456' to succeed. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postSwaggerGlobalValidWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + return service.postSwaggerGlobalValid(this.client.subscriptionId(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postSwaggerGlobalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postSwaggerGlobalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SubscriptionInMethodsInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SubscriptionInMethodsInner.java new file mode 100644 index 0000000000..6394c80b29 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/SubscriptionInMethodsInner.java @@ -0,0 +1,361 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in SubscriptionInMethods. + */ +public class SubscriptionInMethodsInner { + /** The Retrofit service to perform REST calls. */ + private SubscriptionInMethodsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of SubscriptionInMethodsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SubscriptionInMethodsInner(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(SubscriptionInMethodsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SubscriptionInMethods to be + * used by Retrofit to perform actually REST calls. + */ + interface SubscriptionInMethodsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInMethods postMethodLocalValid" }) + @POST("azurespecials/subscriptionId/method/string/none/path/local/1234-5678-9012-3456/{subscriptionId}") + Observable> postMethodLocalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInMethods postMethodLocalNull" }) + @POST("azurespecials/subscriptionId/method/string/none/path/local/null/{subscriptionId}") + Observable> postMethodLocalNull(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInMethods postPathLocalValid" }) + @POST("azurespecials/subscriptionId/path/string/none/path/local/1234-5678-9012-3456/{subscriptionId}") + Observable> postPathLocalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.SubscriptionInMethods postSwaggerLocalValid" }) + @POST("azurespecials/subscriptionId/swagger/string/none/path/local/1234-5678-9012-3456/{subscriptionId}") + Observable> postSwaggerLocalValid(@Path("subscriptionId") String subscriptionId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodLocalValid(String subscriptionId) { + postMethodLocalValidWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodLocalValidWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodLocalValidAsync(String subscriptionId) { + return postMethodLocalValidWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId This should appear as a method parameter, use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodLocalValidWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + return service.postMethodLocalValid(subscriptionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodLocalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postMethodLocalNull(String subscriptionId) { + postMethodLocalNullWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postMethodLocalNullAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postMethodLocalNullWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postMethodLocalNullAsync(String subscriptionId) { + return postMethodLocalNullWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = null, client-side validation should prevent you from making this call. + * + * @param subscriptionId This should appear as a method parameter, use value null, client-side validation should prvenet the call + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postMethodLocalNullWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + return service.postMethodLocalNull(subscriptionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postMethodLocalNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postMethodLocalNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postPathLocalValid(String subscriptionId) { + postPathLocalValidWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postPathLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postPathLocalValidWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postPathLocalValidAsync(String subscriptionId) { + return postPathLocalValidWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId Should appear as a method parameter -use value '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postPathLocalValidWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + return service.postPathLocalValid(subscriptionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postPathLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postPathLocalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postSwaggerLocalValid(String subscriptionId) { + postSwaggerLocalValidWithServiceResponseAsync(subscriptionId).toBlocking().single().body(); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postSwaggerLocalValidAsync(String subscriptionId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postSwaggerLocalValidWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postSwaggerLocalValidAsync(String subscriptionId) { + return postSwaggerLocalValidWithServiceResponseAsync(subscriptionId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * POST method with subscriptionId modeled in the method. pass in subscription id = '1234-5678-9012-3456' to succeed. + * + * @param subscriptionId The subscriptionId, which appears in the path, the value is always '1234-5678-9012-3456' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postSwaggerLocalValidWithServiceResponseAsync(String subscriptionId) { + if (subscriptionId == null) { + throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); + } + return service.postSwaggerLocalValid(subscriptionId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postSwaggerLocalValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postSwaggerLocalValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/XMsClientRequestIdsInner.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/XMsClientRequestIdsInner.java new file mode 100644 index 0000000000..1e9a48f0b3 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/XMsClientRequestIdsInner.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.azurespecials.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.azurespecials.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in XMsClientRequestIds. + */ +public class XMsClientRequestIdsInner { + /** The Retrofit service to perform REST calls. */ + private XMsClientRequestIdsService service; + /** The service client containing this operation class. */ + private AutoRestAzureSpecialParametersTestClientImpl client; + + /** + * Initializes an instance of XMsClientRequestIdsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public XMsClientRequestIdsInner(Retrofit retrofit, AutoRestAzureSpecialParametersTestClientImpl client) { + this.service = retrofit.create(XMsClientRequestIdsService.class); + this.client = client; + } + + /** + * The interface defining all the services for XMsClientRequestIds to be + * used by Retrofit to perform actually REST calls. + */ + interface XMsClientRequestIdsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.XMsClientRequestIds get" }) + @GET("azurespecials/overwrite/x-ms-client-request-id/method/") + Observable> get(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.azurespecials.XMsClientRequestIds paramGet" }) + @GET("azurespecials/overwrite/x-ms-client-request-id/via-param/method/") + Observable> paramGet(@Header("x-ms-client-request-id") String xMsClientRequestId, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get() { + getWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getAsync() { + return getWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithServiceResponseAsync() { + return service.get(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramGet(String xMsClientRequestId) { + paramGetWithServiceResponseAsync(xMsClientRequestId).toBlocking().single().body(); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramGetAsync(String xMsClientRequestId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramGetWithServiceResponseAsync(xMsClientRequestId), serviceCallback); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramGetAsync(String xMsClientRequestId) { + return paramGetWithServiceResponseAsync(xMsClientRequestId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get method that overwrites x-ms-client-request header with value 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0. + * + * @param xMsClientRequestId This should appear as a method parameter, use value '9C4D50EE-2D56-4CD3-8152-34347DC9F2B0' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramGetWithServiceResponseAsync(String xMsClientRequestId) { + if (xMsClientRequestId == null) { + throw new IllegalArgumentException("Parameter xMsClientRequestId is required and cannot be null."); + } + return service.paramGet(xMsClientRequestId, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramGetDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramGetDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/package-info.java new file mode 100644 index 0000000000..141f0e35d6 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestAzureSpecialParametersTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurespecials.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/azurespecials/package-info.java b/test/azurefluent/src/main/java/fixtures/azurespecials/package-info.java new file mode 100644 index 0000000000..414b194aae --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/azurespecials/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestAzureSpecialParametersTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.azurespecials; diff --git a/test/azurefluent/src/main/java/fixtures/custombaseuri/Error.java b/test/azurefluent/src/main/java/fixtures/custombaseuri/Error.java new file mode 100644 index 0000000000..3d76966327 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/custombaseuri/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/custombaseuri/ErrorException.java b/test/azurefluent/src/main/java/fixtures/custombaseuri/ErrorException.java new file mode 100644 index 0000000000..629ef72acb --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/custombaseuri/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java b/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java new file mode 100644 index 0000000000..90335400b2 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AutoRestParameterizedHostTestClientImpl class. + */ +public class AutoRestParameterizedHostTestClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** A string value that is used as a global part of the parameterized host. */ + private String host; + + /** + * Gets A string value that is used as a global part of the parameterized host. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Sets A string value that is used as a global part of the parameterized host. + * + * @param host the host value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withHost(String host) { + this.host = host; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The PathsInner object to access its operations. + */ + private PathsInner paths; + + /** + * Gets the PathsInner object to access its operations. + * @return the PathsInner object. + */ + public PathsInner paths() { + return this.paths; + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestParameterizedHostTestClientImpl(ServiceClientCredentials credentials) { + this("http://{accountName}{host}", credentials); + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + private AutoRestParameterizedHostTestClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestParameterizedHostTestClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.host = "host"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.paths = new PathsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestParameterizedHostTestClient", "1.0.0"); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/PathsInner.java b/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/PathsInner.java new file mode 100644 index 0000000000..8b27d6af1d --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/PathsInner.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.implementation; + +import retrofit2.Retrofit; +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.custombaseuri.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public class PathsInner { + /** The Retrofit service to perform REST calls. */ + private PathsService service; + /** The service client containing this operation class. */ + private AutoRestParameterizedHostTestClientImpl client; + + /** + * Initializes an instance of PathsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PathsInner(Retrofit retrofit, AutoRestParameterizedHostTestClientImpl client) { + this.service = retrofit.create(PathsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Paths to be + * used by Retrofit to perform actually REST calls. + */ + interface PathsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.custombaseuri.Paths getEmpty" }) + @GET("customuri") + Observable> getEmpty(@Header("accept-language") String acceptLanguage, @Header("x-ms-parameterized-host") String parameterizedHost, @Header("User-Agent") String userAgent); + + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getEmpty(String accountName) { + getEmptyWithServiceResponseAsync(accountName).toBlocking().single().body(); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(accountName), serviceCallback); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getEmptyAsync(String accountName) { + return getEmptyWithServiceResponseAsync(accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getEmptyWithServiceResponseAsync(String accountName) { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.host() == null) { + throw new IllegalArgumentException("Parameter this.client.host() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{accountName}", accountName, "{host}", this.client.host()); + return service.getEmpty(this.client.acceptLanguage(), parameterizedHost, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/package-info.java new file mode 100644 index 0000000000..9449c1aeeb --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/custombaseuri/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestParameterizedHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseuri.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/custombaseuri/package-info.java b/test/azurefluent/src/main/java/fixtures/custombaseuri/package-info.java new file mode 100644 index 0000000000..b604c7cd9f --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/custombaseuri/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestParameterizedHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseuri; diff --git a/test/azurefluent/src/main/java/fixtures/head/implementation/AutoRestHeadTestServiceImpl.java b/test/azurefluent/src/main/java/fixtures/head/implementation/AutoRestHeadTestServiceImpl.java new file mode 100644 index 0000000000..d637a67e77 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/head/implementation/AutoRestHeadTestServiceImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.head.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AutoRestHeadTestServiceImpl class. + */ +public class AutoRestHeadTestServiceImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestHeadTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestHeadTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestHeadTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The HttpSuccessInner object to access its operations. + */ + private HttpSuccessInner httpSuccess; + + /** + * Gets the HttpSuccessInner object to access its operations. + * @return the HttpSuccessInner object. + */ + public HttpSuccessInner httpSuccess() { + return this.httpSuccess; + } + + /** + * Initializes an instance of AutoRestHeadTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestHeadTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestHeadTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestHeadTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestHeadTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestHeadTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.httpSuccess = new HttpSuccessInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestHeadTestService", "1.0.0"); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/head/implementation/HttpSuccessInner.java b/test/azurefluent/src/main/java/fixtures/head/implementation/HttpSuccessInner.java new file mode 100644 index 0000000000..4d45615c3f --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/head/implementation/HttpSuccessInner.java @@ -0,0 +1,268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.head.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import retrofit2.http.HEAD; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpSuccess. + */ +public class HttpSuccessInner { + /** The Retrofit service to perform REST calls. */ + private HttpSuccessService service; + /** The service client containing this operation class. */ + private AutoRestHeadTestServiceImpl client; + + /** + * Initializes an instance of HttpSuccessInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HttpSuccessInner(Retrofit retrofit, AutoRestHeadTestServiceImpl client) { + this.service = retrofit.create(HttpSuccessService.class); + this.client = client; + } + + /** + * The interface defining all the services for HttpSuccess to be + * used by Retrofit to perform actually REST calls. + */ + interface HttpSuccessService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.head.HttpSuccess head200" }) + @HEAD("http/success/200") + Observable> head200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.head.HttpSuccess head204" }) + @HEAD("http/success/204") + Observable> head204(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.head.HttpSuccess head404" }) + @HEAD("http/success/404") + Observable> head404(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean head200() { + return head200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 200 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable head200Async() { + return head200WithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> head200WithServiceResponseAsync() { + return service.head200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean head204() { + return head204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 204 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable head204Async() { + return head204WithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> head204WithServiceResponseAsync() { + return service.head204(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean head404() { + return head404WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 404 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head404Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head404WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable head404Async() { + return head404WithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> head404WithServiceResponseAsync() { + return service.head404(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head404Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head404Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/head/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/head/implementation/package-info.java new file mode 100644 index 0000000000..d058ca5a28 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/head/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestHeadTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.head.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/head/package-info.java b/test/azurefluent/src/main/java/fixtures/head/package-info.java new file mode 100644 index 0000000000..0569c93961 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/head/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestHeadTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.head; diff --git a/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/AutoRestHeadExceptionTestServiceImpl.java b/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/AutoRestHeadExceptionTestServiceImpl.java new file mode 100644 index 0000000000..c5584a27bc --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/AutoRestHeadExceptionTestServiceImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.headexceptions.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AutoRestHeadExceptionTestServiceImpl class. + */ +public class AutoRestHeadExceptionTestServiceImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestHeadExceptionTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestHeadExceptionTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestHeadExceptionTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The HeadExceptionsInner object to access its operations. + */ + private HeadExceptionsInner headExceptions; + + /** + * Gets the HeadExceptionsInner object to access its operations. + * @return the HeadExceptionsInner object. + */ + public HeadExceptionsInner headExceptions() { + return this.headExceptions; + } + + /** + * Initializes an instance of AutoRestHeadExceptionTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestHeadExceptionTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestHeadExceptionTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestHeadExceptionTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestHeadExceptionTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestHeadExceptionTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.headExceptions = new HeadExceptionsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestHeadExceptionTestService", "1.0.0"); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/HeadExceptionsInner.java b/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/HeadExceptionsInner.java new file mode 100644 index 0000000000..bec64b9d59 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/HeadExceptionsInner.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.headexceptions.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import retrofit2.http.HEAD; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HeadExceptions. + */ +public class HeadExceptionsInner { + /** The Retrofit service to perform REST calls. */ + private HeadExceptionsService service; + /** The service client containing this operation class. */ + private AutoRestHeadExceptionTestServiceImpl client; + + /** + * Initializes an instance of HeadExceptionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HeadExceptionsInner(Retrofit retrofit, AutoRestHeadExceptionTestServiceImpl client) { + this.service = retrofit.create(HeadExceptionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HeadExceptions to be + * used by Retrofit to perform actually REST calls. + */ + interface HeadExceptionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.headexceptions.HeadExceptions head200" }) + @HEAD("http/success/200") + Observable> head200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.headexceptions.HeadExceptions head204" }) + @HEAD("http/success/204") + Observable> head204(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.headexceptions.HeadExceptions head404" }) + @HEAD("http/success/404") + Observable> head404(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head200() { + head200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 200 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head200Async() { + return head200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head200WithServiceResponseAsync() { + return service.head200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head204() { + head204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 204 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head204Async() { + return head204WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head204WithServiceResponseAsync() { + return service.head204(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head404() { + head404WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 404 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head404Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head404WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head404Async() { + return head404WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 404 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head404WithServiceResponseAsync() { + return service.head404(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head404Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head404Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildEmpty(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/package-info.java new file mode 100644 index 0000000000..db31cf72cf --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/headexceptions/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestHeadExceptionTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.headexceptions.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/headexceptions/package-info.java b/test/azurefluent/src/main/java/fixtures/headexceptions/package-info.java new file mode 100644 index 0000000000..3847d55918 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/headexceptions/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestHeadExceptionTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.headexceptions; diff --git a/test/azurefluent/src/main/java/fixtures/lro/OperationResult.java b/test/azurefluent/src/main/java/fixtures/lro/OperationResult.java new file mode 100644 index 0000000000..4b17cee546 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/OperationResult.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationResult model. + */ +public class OperationResult { + /** + * The status of the request. Possible values include: 'Succeeded', + * 'Failed', 'canceled', 'Accepted', 'Creating', 'Created', 'Updating', + * 'Updated', 'Deleting', 'Deleted', 'OK'. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The error property. + */ + @JsonProperty(value = "error") + private OperationResultError error; + + /** + * Get the status value. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the OperationResult object itself. + */ + public OperationResult withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the error value. + * + * @return the error value + */ + public OperationResultError error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the OperationResult object itself. + */ + public OperationResult withError(OperationResultError error) { + this.error = error; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/OperationResultError.java b/test/azurefluent/src/main/java/fixtures/lro/OperationResultError.java new file mode 100644 index 0000000000..fe64d254ac --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/OperationResultError.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationResultError model. + */ +public class OperationResultError { + /** + * The error code for an operation failure. + */ + @JsonProperty(value = "code") + private Integer code; + + /** + * The detailed arror message. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public Integer code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the OperationResultError object itself. + */ + public OperationResultError withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the OperationResultError object itself. + */ + public OperationResultError withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/AutoRestLongRunningOperationTestServiceImpl.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/AutoRestLongRunningOperationTestServiceImpl.java new file mode 100644 index 0000000000..90801a4b71 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/AutoRestLongRunningOperationTestServiceImpl.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AutoRestLongRunningOperationTestServiceImpl class. + */ +public class AutoRestLongRunningOperationTestServiceImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestLongRunningOperationTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestLongRunningOperationTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestLongRunningOperationTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The LROsInner object to access its operations. + */ + private LROsInner lROs; + + /** + * Gets the LROsInner object to access its operations. + * @return the LROsInner object. + */ + public LROsInner lROs() { + return this.lROs; + } + + /** + * The LRORetrysInner object to access its operations. + */ + private LRORetrysInner lRORetrys; + + /** + * Gets the LRORetrysInner object to access its operations. + * @return the LRORetrysInner object. + */ + public LRORetrysInner lRORetrys() { + return this.lRORetrys; + } + + /** + * The LROSADsInner object to access its operations. + */ + private LROSADsInner lROSADs; + + /** + * Gets the LROSADsInner object to access its operations. + * @return the LROSADsInner object. + */ + public LROSADsInner lROSADs() { + return this.lROSADs; + } + + /** + * The LROsCustomHeadersInner object to access its operations. + */ + private LROsCustomHeadersInner lROsCustomHeaders; + + /** + * Gets the LROsCustomHeadersInner object to access its operations. + * @return the LROsCustomHeadersInner object. + */ + public LROsCustomHeadersInner lROsCustomHeaders() { + return this.lROsCustomHeaders; + } + + /** + * Initializes an instance of AutoRestLongRunningOperationTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestLongRunningOperationTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestLongRunningOperationTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestLongRunningOperationTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestLongRunningOperationTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestLongRunningOperationTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.lROs = new LROsInner(restClient().retrofit(), this); + this.lRORetrys = new LRORetrysInner(restClient().retrofit(), this); + this.lROSADs = new LROSADsInner(restClient().retrofit(), this); + this.lROsCustomHeaders = new LROsCustomHeadersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestLongRunningOperationTestService", "1.0.0"); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDelete202Retry200HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDelete202Retry200HeadersInner.java new file mode 100644 index 0000000000..b8b79afbd9 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDelete202Retry200HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202Retry200 operation. + */ +public class LRORetrysDelete202Retry200HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/delete/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysDelete202Retry200HeadersInner object itself. + */ + public LRORetrysDelete202Retry200HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysDelete202Retry200HeadersInner object itself. + */ + public LRORetrysDelete202Retry200HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..9c99ec4036 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetrySucceeded operation. + */ +public class LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/retryerror/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner.java new file mode 100644 index 0000000000..2037d4d565 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteProvisioning202Accepted200Succeeded operation. + */ +public class LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/delete/provisioning/202/accepted/200/succeeded. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner object itself. + */ + public LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner object itself. + */ + public LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysInner.java new file mode 100644 index 0000000000..29395eb71d --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysInner.java @@ -0,0 +1,1388 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LRORetrys. + */ +public class LRORetrysInner { + /** The Retrofit service to perform REST calls. */ + private LRORetrysService service; + /** The service client containing this operation class. */ + private AutoRestLongRunningOperationTestServiceImpl client; + + /** + * Initializes an instance of LRORetrysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LRORetrysInner(Retrofit retrofit, AutoRestLongRunningOperationTestServiceImpl client) { + this.service = retrofit.create(LRORetrysService.class); + this.client = client; + } + + /** + * The interface defining all the services for LRORetrys to be + * used by Retrofit to perform actually REST calls. + */ + interface LRORetrysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys put201CreatingSucceeded200" }) + @PUT("lro/retryerror/put/201/creating/succeeded/200") + Observable> put201CreatingSucceeded200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginPut201CreatingSucceeded200" }) + @PUT("lro/retryerror/put/201/creating/succeeded/200") + Observable> beginPut201CreatingSucceeded200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys putAsyncRelativeRetrySucceeded" }) + @PUT("lro/retryerror/putasync/retry/succeeded") + Observable> putAsyncRelativeRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginPutAsyncRelativeRetrySucceeded" }) + @PUT("lro/retryerror/putasync/retry/succeeded") + Observable> beginPutAsyncRelativeRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys deleteProvisioning202Accepted200Succeeded" }) + @HTTP(path = "lro/retryerror/delete/provisioning/202/accepted/200/succeeded", method = "DELETE", hasBody = true) + Observable> deleteProvisioning202Accepted200Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginDeleteProvisioning202Accepted200Succeeded" }) + @HTTP(path = "lro/retryerror/delete/provisioning/202/accepted/200/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteProvisioning202Accepted200Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys delete202Retry200" }) + @HTTP(path = "lro/retryerror/delete/202/retry/200", method = "DELETE", hasBody = true) + Observable> delete202Retry200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginDelete202Retry200" }) + @HTTP(path = "lro/retryerror/delete/202/retry/200", method = "DELETE", hasBody = true) + Observable> beginDelete202Retry200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys deleteAsyncRelativeRetrySucceeded" }) + @HTTP(path = "lro/retryerror/deleteasync/retry/succeeded", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginDeleteAsyncRelativeRetrySucceeded" }) + @HTTP(path = "lro/retryerror/deleteasync/retry/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys post202Retry200" }) + @POST("lro/retryerror/post/202/retry/200") + Observable> post202Retry200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginPost202Retry200" }) + @POST("lro/retryerror/post/202/retry/200") + Observable> beginPost202Retry200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys postAsyncRelativeRetrySucceeded" }) + @POST("lro/retryerror/postasync/retry/succeeded") + Observable> postAsyncRelativeRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LRORetrys beginPostAsyncRelativeRetrySucceeded" }) + @POST("lro/retryerror/postasync/retry/succeeded") + Observable> beginPostAsyncRelativeRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put201CreatingSucceeded200() { + return put201CreatingSucceeded200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async() { + return put201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put201CreatingSucceeded200(ProductInner product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async(ProductInner product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut201CreatingSucceeded200() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut201CreatingSucceeded200Async() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut201CreatingSucceeded200(ProductInner product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut201CreatingSucceeded200Async(ProductInner product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut201CreatingSucceeded200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetrySucceeded() { + return putAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetrySucceededAsync() { + return putAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPutAsyncRelativeRetrySucceededHeadersInner.class); + } + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetrySucceeded(ProductInner product) { + return putAsyncRelativeRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetrySucceededAsync(ProductInner product) { + return putAsyncRelativeRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPutAsyncRelativeRetrySucceededHeadersInner.class); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetrySucceeded() { + return beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetrySucceededAsync() { + return beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetrySucceeded(ProductInner product) { + return beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetrySucceededAsync(ProductInner product) { + return beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 500, then a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysPutAsyncRelativeRetrySucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner deleteProvisioning202Accepted200Succeeded() { + return deleteProvisioning202Accepted200SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteProvisioning202Accepted200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteProvisioning202Accepted200SucceededAsync() { + return deleteProvisioning202Accepted200SucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteProvisioning202Accepted200SucceededWithServiceResponseAsync() { + Observable> observable = service.deleteProvisioning202Accepted200Succeeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginDeleteProvisioning202Accepted200Succeeded() { + return beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginDeleteProvisioning202Accepted200SucceededAsync() { + return beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync() { + return service.beginDeleteProvisioning202Accepted200Succeeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteProvisioning202Accepted200SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteProvisioning202Accepted200SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysDeleteProvisioning202Accepted200SucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete202Retry200() { + delete202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202Retry200Async() { + return delete202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202Retry200WithServiceResponseAsync() { + Observable> observable = service.delete202Retry200(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysDelete202Retry200HeadersInner.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete202Retry200() { + beginDelete202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDelete202Retry200Async() { + return beginDelete202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDelete202Retry200WithServiceResponseAsync() { + return service.beginDelete202Retry200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysDelete202Retry200HeadersInner.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetrySucceeded() { + deleteAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetrySucceededAsync() { + return deleteAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetrySucceededWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetrySucceeded() { + beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetrySucceededAsync() { + return beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 500, then a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetrySucceededWithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysDeleteAsyncRelativeRetrySucceededHeadersInner.class); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200() { + post202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async() { + return post202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPost202Retry200HeadersInner.class); + } + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200(ProductInner product) { + post202Retry200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async(ProductInner product) { + return post202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPost202Retry200HeadersInner.class); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200() { + beginPost202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async() { + return beginPost202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200(ProductInner product) { + beginPost202Retry200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async(ProductInner product) { + return beginPost202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysPost202Retry200HeadersInner.class); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetrySucceeded() { + postAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetrySucceededAsync() { + return postAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPostAsyncRelativeRetrySucceededHeadersInner.class); + } + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetrySucceeded(ProductInner product) { + postAsyncRelativeRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetrySucceededAsync(ProductInner product) { + return postAsyncRelativeRetrySucceededWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LRORetrysPostAsyncRelativeRetrySucceededHeadersInner.class); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetrySucceeded() { + beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetrySucceededAsync() { + return beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetrySucceeded(ProductInner product) { + beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetrySucceededAsync(ProductInner product) { + return beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 500, then a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LRORetrysPostAsyncRelativeRetrySucceededHeadersInner.class); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPost202Retry200HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPost202Retry200HeadersInner.java new file mode 100644 index 0000000000..f015d92b78 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPost202Retry200HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202Retry200 operation. + */ +public class LRORetrysPost202Retry200HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysPost202Retry200HeadersInner object itself. + */ + public LRORetrysPost202Retry200HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysPost202Retry200HeadersInner object itself. + */ + public LRORetrysPost202Retry200HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPostAsyncRelativeRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPostAsyncRelativeRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..5f64f62bf3 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPostAsyncRelativeRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetrySucceeded operation. + */ +public class LRORetrysPostAsyncRelativeRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/retryerror/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LRORetrysPostAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysPostAsyncRelativeRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysPostAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysPostAsyncRelativeRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysPostAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysPostAsyncRelativeRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPutAsyncRelativeRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPutAsyncRelativeRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..837277dfcb --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LRORetrysPutAsyncRelativeRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetrySucceeded operation. + */ +public class LRORetrysPutAsyncRelativeRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/retryerror/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LRORetrysPutAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysPutAsyncRelativeRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LRORetrysPutAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysPutAsyncRelativeRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LRORetrysPutAsyncRelativeRetrySucceededHeadersInner object itself. + */ + public LRORetrysPutAsyncRelativeRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDelete202NonRetry400HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDelete202NonRetry400HeadersInner.java new file mode 100644 index 0000000000..50467c45e1 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDelete202NonRetry400HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202NonRetry400 operation. + */ +public class LROSADsDelete202NonRetry400HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/delete/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDelete202NonRetry400HeadersInner object itself. + */ + public LROSADsDelete202NonRetry400HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDelete202NonRetry400HeadersInner object itself. + */ + public LROSADsDelete202NonRetry400HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDelete202RetryInvalidHeaderHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDelete202RetryInvalidHeaderHeadersInner.java new file mode 100644 index 0000000000..0d5f447771 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDelete202RetryInvalidHeaderHeadersInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202RetryInvalidHeader operation. + */ +public class LROSADsDelete202RetryInvalidHeaderHeadersInner { + /** + * Location to poll for result status: will be set to /foo. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to /bar. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDelete202RetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsDelete202RetryInvalidHeaderHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDelete202RetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsDelete202RetryInvalidHeaderHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetry400HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetry400HeadersInner.java new file mode 100644 index 0000000000..55fdf8bdc0 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetry400HeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetry400 operation. + */ +public class LROSADsDeleteAsyncRelativeRetry400HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/deleteasync/retry/operationResults/400. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/deleteasync/retry/operationResults/400. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsDeleteAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetry400HeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetry400HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetry400HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner.java new file mode 100644 index 0000000000..802d88b21c --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetryInvalidHeader operation. + */ +public class LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner { + /** + * Location to poll for result status: will be set to /foo. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to /foo. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to /bar. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner.java new file mode 100644 index 0000000000..d4e91e84d9 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetryInvalidJsonPolling operation. + */ +public class LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/error/deleteasync/retry/failed/operationResults/invalidjsonpolling. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/error/deleteasync/retry/failed/operationResults/invalidjsonpolling. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner.java new file mode 100644 index 0000000000..a898edd02d --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRelativeRetryNoStatus operation. + */ +public class LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner object itself. + */ + public LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteNonRetry400HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteNonRetry400HeadersInner.java new file mode 100644 index 0000000000..033b14d540 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsDeleteNonRetry400HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteNonRetry400 operation. + */ +public class LROSADsDeleteNonRetry400HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/delete/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsDeleteNonRetry400HeadersInner object itself. + */ + public LROSADsDeleteNonRetry400HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsDeleteNonRetry400HeadersInner object itself. + */ + public LROSADsDeleteNonRetry400HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsInner.java new file mode 100644 index 0000000000..80ca71e2f3 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsInner.java @@ -0,0 +1,5358 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROSADs. + */ +public class LROSADsInner { + /** The Retrofit service to perform REST calls. */ + private LROSADsService service; + /** The service client containing this operation class. */ + private AutoRestLongRunningOperationTestServiceImpl client; + + /** + * Initializes an instance of LROSADsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LROSADsInner(Retrofit retrofit, AutoRestLongRunningOperationTestServiceImpl client) { + this.service = retrofit.create(LROSADsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LROSADs to be + * used by Retrofit to perform actually REST calls. + */ + interface LROSADsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putNonRetry400" }) + @PUT("lro/nonretryerror/put/400") + Observable> putNonRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutNonRetry400" }) + @PUT("lro/nonretryerror/put/400") + Observable> beginPutNonRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putNonRetry201Creating400" }) + @PUT("lro/nonretryerror/put/201/creating/400") + Observable> putNonRetry201Creating400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutNonRetry201Creating400" }) + @PUT("lro/nonretryerror/put/201/creating/400") + Observable> beginPutNonRetry201Creating400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putNonRetry201Creating400InvalidJson" }) + @PUT("lro/nonretryerror/put/201/creating/400/invalidjson") + Observable> putNonRetry201Creating400InvalidJson(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutNonRetry201Creating400InvalidJson" }) + @PUT("lro/nonretryerror/put/201/creating/400/invalidjson") + Observable> beginPutNonRetry201Creating400InvalidJson(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetry400" }) + @PUT("lro/nonretryerror/putasync/retry/400") + Observable> putAsyncRelativeRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetry400" }) + @PUT("lro/nonretryerror/putasync/retry/400") + Observable> beginPutAsyncRelativeRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteNonRetry400" }) + @HTTP(path = "lro/nonretryerror/delete/400", method = "DELETE", hasBody = true) + Observable> deleteNonRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteNonRetry400" }) + @HTTP(path = "lro/nonretryerror/delete/400", method = "DELETE", hasBody = true) + Observable> beginDeleteNonRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs delete202NonRetry400" }) + @HTTP(path = "lro/nonretryerror/delete/202/retry/400", method = "DELETE", hasBody = true) + Observable> delete202NonRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDelete202NonRetry400" }) + @HTTP(path = "lro/nonretryerror/delete/202/retry/400", method = "DELETE", hasBody = true) + Observable> beginDelete202NonRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteAsyncRelativeRetry400" }) + @HTTP(path = "lro/nonretryerror/deleteasync/retry/400", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteAsyncRelativeRetry400" }) + @HTTP(path = "lro/nonretryerror/deleteasync/retry/400", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetry400(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postNonRetry400" }) + @POST("lro/nonretryerror/post/400") + Observable> postNonRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostNonRetry400" }) + @POST("lro/nonretryerror/post/400") + Observable> beginPostNonRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs post202NonRetry400" }) + @POST("lro/nonretryerror/post/202/retry/400") + Observable> post202NonRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPost202NonRetry400" }) + @POST("lro/nonretryerror/post/202/retry/400") + Observable> beginPost202NonRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postAsyncRelativeRetry400" }) + @POST("lro/nonretryerror/postasync/retry/400") + Observable> postAsyncRelativeRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostAsyncRelativeRetry400" }) + @POST("lro/nonretryerror/postasync/retry/400") + Observable> beginPostAsyncRelativeRetry400(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putError201NoProvisioningStatePayload" }) + @PUT("lro/error/put/201/noprovisioningstatepayload") + Observable> putError201NoProvisioningStatePayload(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutError201NoProvisioningStatePayload" }) + @PUT("lro/error/put/201/noprovisioningstatepayload") + Observable> beginPutError201NoProvisioningStatePayload(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetryNoStatus" }) + @PUT("lro/error/putasync/retry/nostatus") + Observable> putAsyncRelativeRetryNoStatus(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetryNoStatus" }) + @PUT("lro/error/putasync/retry/nostatus") + Observable> beginPutAsyncRelativeRetryNoStatus(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetryNoStatusPayload" }) + @PUT("lro/error/putasync/retry/nostatuspayload") + Observable> putAsyncRelativeRetryNoStatusPayload(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetryNoStatusPayload" }) + @PUT("lro/error/putasync/retry/nostatuspayload") + Observable> beginPutAsyncRelativeRetryNoStatusPayload(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs delete204Succeeded" }) + @HTTP(path = "lro/error/delete/204/nolocation", method = "DELETE", hasBody = true) + Observable> delete204Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDelete204Succeeded" }) + @HTTP(path = "lro/error/delete/204/nolocation", method = "DELETE", hasBody = true) + Observable> beginDelete204Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteAsyncRelativeRetryNoStatus" }) + @HTTP(path = "lro/error/deleteasync/retry/nostatus", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetryNoStatus(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteAsyncRelativeRetryNoStatus" }) + @HTTP(path = "lro/error/deleteasync/retry/nostatus", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetryNoStatus(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs post202NoLocation" }) + @POST("lro/error/post/202/nolocation") + Observable> post202NoLocation(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPost202NoLocation" }) + @POST("lro/error/post/202/nolocation") + Observable> beginPost202NoLocation(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postAsyncRelativeRetryNoPayload" }) + @POST("lro/error/postasync/retry/nopayload") + Observable> postAsyncRelativeRetryNoPayload(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostAsyncRelativeRetryNoPayload" }) + @POST("lro/error/postasync/retry/nopayload") + Observable> beginPostAsyncRelativeRetryNoPayload(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs put200InvalidJson" }) + @PUT("lro/error/put/200/invalidjson") + Observable> put200InvalidJson(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPut200InvalidJson" }) + @PUT("lro/error/put/200/invalidjson") + Observable> beginPut200InvalidJson(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetryInvalidHeader" }) + @PUT("lro/error/putasync/retry/invalidheader") + Observable> putAsyncRelativeRetryInvalidHeader(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetryInvalidHeader" }) + @PUT("lro/error/putasync/retry/invalidheader") + Observable> beginPutAsyncRelativeRetryInvalidHeader(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs putAsyncRelativeRetryInvalidJsonPolling" }) + @PUT("lro/error/putasync/retry/invalidjsonpolling") + Observable> putAsyncRelativeRetryInvalidJsonPolling(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPutAsyncRelativeRetryInvalidJsonPolling" }) + @PUT("lro/error/putasync/retry/invalidjsonpolling") + Observable> beginPutAsyncRelativeRetryInvalidJsonPolling(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs delete202RetryInvalidHeader" }) + @HTTP(path = "lro/error/delete/202/retry/invalidheader", method = "DELETE", hasBody = true) + Observable> delete202RetryInvalidHeader(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDelete202RetryInvalidHeader" }) + @HTTP(path = "lro/error/delete/202/retry/invalidheader", method = "DELETE", hasBody = true) + Observable> beginDelete202RetryInvalidHeader(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteAsyncRelativeRetryInvalidHeader" }) + @HTTP(path = "lro/error/deleteasync/retry/invalidheader", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetryInvalidHeader(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteAsyncRelativeRetryInvalidHeader" }) + @HTTP(path = "lro/error/deleteasync/retry/invalidheader", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetryInvalidHeader(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs deleteAsyncRelativeRetryInvalidJsonPolling" }) + @HTTP(path = "lro/error/deleteasync/retry/invalidjsonpolling", method = "DELETE", hasBody = true) + Observable> deleteAsyncRelativeRetryInvalidJsonPolling(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginDeleteAsyncRelativeRetryInvalidJsonPolling" }) + @HTTP(path = "lro/error/deleteasync/retry/invalidjsonpolling", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRelativeRetryInvalidJsonPolling(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs post202RetryInvalidHeader" }) + @POST("lro/error/post/202/retry/invalidheader") + Observable> post202RetryInvalidHeader(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPost202RetryInvalidHeader" }) + @POST("lro/error/post/202/retry/invalidheader") + Observable> beginPost202RetryInvalidHeader(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postAsyncRelativeRetryInvalidHeader" }) + @POST("lro/error/postasync/retry/invalidheader") + Observable> postAsyncRelativeRetryInvalidHeader(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostAsyncRelativeRetryInvalidHeader" }) + @POST("lro/error/postasync/retry/invalidheader") + Observable> beginPostAsyncRelativeRetryInvalidHeader(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs postAsyncRelativeRetryInvalidJsonPolling" }) + @POST("lro/error/postasync/retry/invalidjsonpolling") + Observable> postAsyncRelativeRetryInvalidJsonPolling(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROSADs beginPostAsyncRelativeRetryInvalidJsonPolling" }) + @POST("lro/error/postasync/retry/invalidjsonpolling") + Observable> beginPostAsyncRelativeRetryInvalidJsonPolling(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putNonRetry400() { + return putNonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry400Async() { + return putNonRetry400WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry400WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putNonRetry400(ProductInner product) { + return putNonRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry400Async(ProductInner product) { + return putNonRetry400WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutNonRetry400() { + return beginPutNonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutNonRetry400Async() { + return beginPutNonRetry400WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutNonRetry400WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutNonRetry400(ProductInner product) { + return beginPutNonRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutNonRetry400Async(ProductInner product) { + return beginPutNonRetry400WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 400 to the initial request. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutNonRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutNonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putNonRetry201Creating400() { + return putNonRetry201Creating400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry201Creating400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry201Creating400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry201Creating400Async() { + return putNonRetry201Creating400WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry201Creating400WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putNonRetry201Creating400(ProductInner product) { + return putNonRetry201Creating400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry201Creating400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry201Creating400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry201Creating400Async(ProductInner product) { + return putNonRetry201Creating400WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry201Creating400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutNonRetry201Creating400() { + return beginPutNonRetry201Creating400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry201Creating400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry201Creating400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutNonRetry201Creating400Async() { + return beginPutNonRetry201Creating400WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutNonRetry201Creating400WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry201Creating400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutNonRetry201Creating400(ProductInner product) { + return beginPutNonRetry201Creating400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry201Creating400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry201Creating400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutNonRetry201Creating400Async(ProductInner product) { + return beginPutNonRetry201Creating400WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutNonRetry201Creating400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutNonRetry201Creating400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry201Creating400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutNonRetry201Creating400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putNonRetry201Creating400InvalidJson() { + return putNonRetry201Creating400InvalidJsonWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry201Creating400InvalidJsonAsync() { + return putNonRetry201Creating400InvalidJsonWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry201Creating400InvalidJsonWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putNonRetry201Creating400InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putNonRetry201Creating400InvalidJson(ProductInner product) { + return putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonRetry201Creating400InvalidJsonAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonRetry201Creating400InvalidJsonAsync(ProductInner product) { + return putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonRetry201Creating400InvalidJsonWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putNonRetry201Creating400InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutNonRetry201Creating400InvalidJson() { + return beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry201Creating400InvalidJsonAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutNonRetry201Creating400InvalidJsonAsync() { + return beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutNonRetry201Creating400InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry201Creating400InvalidJsonDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutNonRetry201Creating400InvalidJson(ProductInner product) { + return beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonRetry201Creating400InvalidJsonAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutNonRetry201Creating400InvalidJsonAsync(ProductInner product) { + return beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a Product with 'ProvisioningState' = 'Creating' and 201 response code. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutNonRetry201Creating400InvalidJsonWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutNonRetry201Creating400InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonRetry201Creating400InvalidJsonDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutNonRetry201Creating400InvalidJsonDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetry400() { + return putAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetry400Async() { + return putAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetry400WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetry400HeadersInner.class); + } + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetry400(ProductInner product) { + return putAsyncRelativeRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetry400Async(ProductInner product) { + return putAsyncRelativeRetry400WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetry400HeadersInner.class); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetry400() { + return beginPutAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetry400Async() { + return beginPutAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetry400WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetry400(ProductInner product) { + return beginPutAsyncRelativeRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetry400Async(ProductInner product) { + return beginPutAsyncRelativeRetry400WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 with ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetry400HeadersInner.class); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteNonRetry400() { + deleteNonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteNonRetry400Async() { + return deleteNonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteNonRetry400WithServiceResponseAsync() { + Observable> observable = service.deleteNonRetry400(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteNonRetry400HeadersInner.class); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteNonRetry400() { + beginDeleteNonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteNonRetry400Async() { + return beginDeleteNonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 400 with an error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteNonRetry400WithServiceResponseAsync() { + return service.beginDeleteNonRetry400(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteNonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteNonRetry400HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete202NonRetry400() { + delete202NonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202NonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202NonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202NonRetry400Async() { + return delete202NonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202NonRetry400WithServiceResponseAsync() { + Observable> observable = service.delete202NonRetry400(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDelete202NonRetry400HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete202NonRetry400() { + beginDelete202NonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202NonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202NonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDelete202NonRetry400Async() { + return beginDelete202NonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDelete202NonRetry400WithServiceResponseAsync() { + return service.beginDelete202NonRetry400(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202NonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202NonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDelete202NonRetry400HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetry400() { + deleteAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetry400Async() { + return deleteAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetry400WithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetry400(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteAsyncRelativeRetry400HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetry400() { + beginDeleteAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetry400Async() { + return beginDeleteAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetry400WithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetry400(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteAsyncRelativeRetry400HeadersInner.class); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postNonRetry400() { + postNonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postNonRetry400Async() { + return postNonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postNonRetry400WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostNonRetry400HeadersInner.class); + } + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postNonRetry400(ProductInner product) { + postNonRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postNonRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postNonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postNonRetry400Async(ProductInner product) { + return postNonRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postNonRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostNonRetry400HeadersInner.class); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostNonRetry400() { + beginPostNonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostNonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostNonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostNonRetry400Async() { + return beginPostNonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostNonRetry400WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostNonRetry400(ProductInner product) { + beginPostNonRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostNonRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostNonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostNonRetry400Async(ProductInner product) { + return beginPostNonRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 400 with no error body. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostNonRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostNonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostNonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostNonRetry400HeadersInner.class); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202NonRetry400() { + post202NonRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NonRetry400Async() { + return post202NonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NonRetry400WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.post202NonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202NonRetry400HeadersInner.class); + } + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202NonRetry400(ProductInner product) { + post202NonRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NonRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NonRetry400Async(ProductInner product) { + return post202NonRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NonRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.post202NonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202NonRetry400HeadersInner.class); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202NonRetry400() { + beginPost202NonRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NonRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NonRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202NonRetry400Async() { + return beginPost202NonRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202NonRetry400WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPost202NonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202NonRetry400(ProductInner product) { + beginPost202NonRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NonRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NonRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202NonRetry400Async(ProductInner product) { + return beginPost202NonRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 with a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202NonRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPost202NonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NonRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202NonRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPost202NonRetry400HeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetry400() { + postAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetry400Async() { + return postAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetry400WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetry400HeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetry400(ProductInner product) { + postAsyncRelativeRetry400WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetry400Async(ProductInner product) { + return postAsyncRelativeRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetry400HeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetry400() { + beginPostAsyncRelativeRetry400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetry400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetry400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetry400Async() { + return beginPostAsyncRelativeRetry400WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetry400WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetry400(ProductInner product) { + beginPostAsyncRelativeRetry400WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetry400Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetry400WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetry400Async(ProductInner product) { + return beginPostAsyncRelativeRetry400WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetry400WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetry400(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetry400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetry400Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostAsyncRelativeRetry400HeadersInner.class); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putError201NoProvisioningStatePayload() { + return putError201NoProvisioningStatePayloadWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putError201NoProvisioningStatePayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putError201NoProvisioningStatePayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putError201NoProvisioningStatePayloadAsync() { + return putError201NoProvisioningStatePayloadWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putError201NoProvisioningStatePayloadWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putError201NoProvisioningStatePayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putError201NoProvisioningStatePayload(ProductInner product) { + return putError201NoProvisioningStatePayloadWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putError201NoProvisioningStatePayloadAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putError201NoProvisioningStatePayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putError201NoProvisioningStatePayloadAsync(ProductInner product) { + return putError201NoProvisioningStatePayloadWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putError201NoProvisioningStatePayloadWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putError201NoProvisioningStatePayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutError201NoProvisioningStatePayload() { + return beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutError201NoProvisioningStatePayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutError201NoProvisioningStatePayloadAsync() { + return beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutError201NoProvisioningStatePayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutError201NoProvisioningStatePayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutError201NoProvisioningStatePayload(ProductInner product) { + return beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutError201NoProvisioningStatePayloadAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutError201NoProvisioningStatePayloadAsync(ProductInner product) { + return beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request with no payload. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutError201NoProvisioningStatePayloadWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutError201NoProvisioningStatePayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutError201NoProvisioningStatePayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutError201NoProvisioningStatePayloadDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetryNoStatus() { + return putAsyncRelativeRetryNoStatusWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryNoStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryNoStatusAsync() { + return putAsyncRelativeRetryNoStatusWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryNoStatusWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryNoStatusHeadersInner.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetryNoStatus(ProductInner product) { + return putAsyncRelativeRetryNoStatusWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryNoStatusAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryNoStatusWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryNoStatusAsync(ProductInner product) { + return putAsyncRelativeRetryNoStatusWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryNoStatusWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryNoStatusHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetryNoStatus() { + return beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetryNoStatusAsync() { + return beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryNoStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetryNoStatus(ProductInner product) { + return beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryNoStatusAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetryNoStatusAsync(ProductInner product) { + return beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetryNoStatusWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetryNoStatus(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryNoStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetryNoStatusDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetryNoStatusHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetryNoStatusPayload() { + return putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryNoStatusPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryNoStatusPayloadAsync() { + return putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRelativeRetryNoStatusPayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetryNoStatusPayload(ProductInner product) { + return putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryNoStatusPayloadAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryNoStatusPayloadAsync(ProductInner product) { + return putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetryNoStatusPayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetryNoStatusPayload() { + return beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryNoStatusPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetryNoStatusPayloadAsync() { + return beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRelativeRetryNoStatusPayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryNoStatusPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetryNoStatusPayload(ProductInner product) { + return beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryNoStatusPayloadAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetryNoStatusPayloadAsync(ProductInner product) { + return beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetryNoStatusPayloadWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetryNoStatusPayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryNoStatusPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetryNoStatusPayloadDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner.class); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete204Succeeded() { + delete204SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete204SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete204SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete204SucceededAsync() { + return delete204SucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete204SucceededWithServiceResponseAsync() { + Observable> observable = service.delete204Succeeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete204Succeeded() { + beginDelete204SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete204SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDelete204SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDelete204SucceededAsync() { + return beginDelete204SucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 204 to the initial request, indicating success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDelete204SucceededWithServiceResponseAsync() { + return service.beginDelete204Succeeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDelete204SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDelete204SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetryNoStatus() { + deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetryNoStatusAsync() { + return deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetryNoStatusWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetryNoStatus(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetryNoStatus() { + beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetryNoStatusAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetryNoStatusAsync() { + return beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetryNoStatusWithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetryNoStatus(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetryNoStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetryNoStatusDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteAsyncRelativeRetryNoStatusHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202NoLocation() { + post202NoLocationWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NoLocationAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NoLocationWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NoLocationAsync() { + return post202NoLocationWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NoLocationWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.post202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202NoLocationHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202NoLocation(ProductInner product) { + post202NoLocationWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NoLocationAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NoLocationWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NoLocationAsync(ProductInner product) { + return post202NoLocationWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NoLocationWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.post202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202NoLocationHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202NoLocation() { + beginPost202NoLocationWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NoLocationAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NoLocationWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202NoLocationAsync() { + return beginPost202NoLocationWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202NoLocationWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPost202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NoLocationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202NoLocation(ProductInner product) { + beginPost202NoLocationWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NoLocationAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NoLocationWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202NoLocationAsync(ProductInner product) { + return beginPost202NoLocationWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, without a location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202NoLocationWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPost202NoLocation(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NoLocationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202NoLocationDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPost202NoLocationHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryNoPayload() { + postAsyncRelativeRetryNoPayloadWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryNoPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryNoPayloadAsync() { + return postAsyncRelativeRetryNoPayloadWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryNoPayloadWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRelativeRetryNoPayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryNoPayload(ProductInner product) { + postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryNoPayloadAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryNoPayloadAsync(ProductInner product) { + return postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryNoPayloadWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetryNoPayload(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryNoPayload() { + beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryNoPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryNoPayloadAsync() { + return beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRelativeRetryNoPayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryNoPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryNoPayload(ProductInner product) { + beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryNoPayloadAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryNoPayloadAsync(ProductInner product) { + return beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryNoPayloadWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetryNoPayload(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryNoPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetryNoPayloadDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200InvalidJson() { + return put200InvalidJsonWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200InvalidJsonAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200InvalidJsonWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200InvalidJsonAsync() { + return put200InvalidJsonWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200InvalidJsonWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put200InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200InvalidJson(ProductInner product) { + return put200InvalidJsonWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200InvalidJsonAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200InvalidJsonWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200InvalidJsonAsync(ProductInner product) { + return put200InvalidJsonWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200InvalidJsonWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put200InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200InvalidJson() { + return beginPut200InvalidJsonWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200InvalidJsonAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200InvalidJsonWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200InvalidJsonAsync() { + return beginPut200InvalidJsonWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200InvalidJsonWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut200InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200InvalidJsonDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200InvalidJson(ProductInner product) { + return beginPut200InvalidJsonWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200InvalidJsonAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200InvalidJsonWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200InvalidJsonAsync(ProductInner product) { + return beginPut200InvalidJsonWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that is not a valid json. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200InvalidJsonWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut200InvalidJson(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200InvalidJsonDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200InvalidJsonDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetryInvalidHeader() { + return putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryInvalidHeaderAsync() { + return putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetryInvalidHeader(ProductInner product) { + return putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryInvalidHeaderAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryInvalidHeaderAsync(ProductInner product) { + return putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetryInvalidHeader() { + return beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetryInvalidHeaderAsync() { + return beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetryInvalidHeader(ProductInner product) { + return beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryInvalidHeaderAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetryInvalidHeaderAsync(ProductInner product) { + return beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetryInvalidJsonPolling() { + return putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryInvalidJsonPollingAsync() { + return putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRelativeRetryInvalidJsonPolling(ProductInner product) { + return putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRelativeRetryInvalidJsonPollingAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRelativeRetryInvalidJsonPollingAsync(ProductInner product) { + return putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetryInvalidJsonPolling() { + return beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetryInvalidJsonPollingAsync() { + return beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRelativeRetryInvalidJsonPolling(ProductInner product) { + return beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRelativeRetryInvalidJsonPollingAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRelativeRetryInvalidJsonPollingAsync(ProductInner product) { + return beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRelativeRetryInvalidJsonPollingDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete202RetryInvalidHeader() { + delete202RetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202RetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202RetryInvalidHeaderAsync() { + return delete202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202RetryInvalidHeaderWithServiceResponseAsync() { + Observable> observable = service.delete202RetryInvalidHeader(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDelete202RetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete202RetryInvalidHeader() { + beginDelete202RetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202RetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDelete202RetryInvalidHeaderAsync() { + return beginDelete202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request receing a reponse with an invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDelete202RetryInvalidHeaderWithServiceResponseAsync() { + return service.beginDelete202RetryInvalidHeader(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202RetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202RetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDelete202RetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetryInvalidHeader() { + deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetryInvalidHeaderAsync() { + return deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetryInvalidHeader(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetryInvalidHeader() { + beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetryInvalidHeaderAsync() { + return beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetryInvalidHeader(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteAsyncRelativeRetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRelativeRetryInvalidJsonPolling() { + deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRelativeRetryInvalidJsonPollingAsync() { + return deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRelativeRetryInvalidJsonPolling(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRelativeRetryInvalidJsonPolling() { + beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRelativeRetryInvalidJsonPollingAsync() { + return beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + return service.beginDeleteAsyncRelativeRetryInvalidJsonPolling(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRelativeRetryInvalidJsonPollingDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsDeleteAsyncRelativeRetryInvalidJsonPollingHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202RetryInvalidHeader() { + post202RetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202RetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202RetryInvalidHeaderAsync() { + return post202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202RetryInvalidHeaderWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.post202RetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202RetryInvalidHeaderHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202RetryInvalidHeader(ProductInner product) { + post202RetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202RetryInvalidHeaderAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202RetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202RetryInvalidHeaderAsync(ProductInner product) { + return post202RetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202RetryInvalidHeaderWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.post202RetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPost202RetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202RetryInvalidHeader() { + beginPost202RetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202RetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202RetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202RetryInvalidHeaderAsync() { + return beginPost202RetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202RetryInvalidHeaderWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPost202RetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202RetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202RetryInvalidHeader(ProductInner product) { + beginPost202RetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202RetryInvalidHeaderAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202RetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202RetryInvalidHeaderAsync(ProductInner product) { + return beginPost202RetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with invalid 'Location' and 'Retry-After' headers. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202RetryInvalidHeaderWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPost202RetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202RetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202RetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPost202RetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryInvalidHeader() { + postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryInvalidHeaderAsync() { + return postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryInvalidHeader(ProductInner product) { + postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryInvalidHeaderAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryInvalidHeaderAsync(ProductInner product) { + return postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryInvalidHeader() { + beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryInvalidHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryInvalidHeaderAsync() { + return beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryInvalidHeader(ProductInner product) { + beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryInvalidHeaderAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryInvalidHeaderAsync(ProductInner product) { + return beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. The endpoint indicated in the Azure-AsyncOperation header is invalid. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryInvalidHeaderWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetryInvalidHeader(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryInvalidHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetryInvalidHeaderDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryInvalidJsonPolling() { + postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryInvalidJsonPollingAsync() { + return postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRelativeRetryInvalidJsonPolling(ProductInner product) { + postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRelativeRetryInvalidJsonPollingAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRelativeRetryInvalidJsonPollingAsync(ProductInner product) { + return postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryInvalidJsonPolling() { + beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryInvalidJsonPollingAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryInvalidJsonPollingAsync() { + return beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRelativeRetryInvalidJsonPolling(ProductInner product) { + beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRelativeRetryInvalidJsonPollingAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRelativeRetryInvalidJsonPollingAsync(ProductInner product) { + return beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRelativeRetryInvalidJsonPollingWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRelativeRetryInvalidJsonPolling(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRelativeRetryInvalidJsonPollingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRelativeRetryInvalidJsonPollingDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner.class); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202NoLocationHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202NoLocationHeadersInner.java new file mode 100644 index 0000000000..63ea4f8c66 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202NoLocationHeadersInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202NoLocation operation. + */ +public class LROSADsPost202NoLocationHeadersInner { + /** + * Location to poll for result status: will not be set. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPost202NoLocationHeadersInner object itself. + */ + public LROSADsPost202NoLocationHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPost202NoLocationHeadersInner object itself. + */ + public LROSADsPost202NoLocationHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202NonRetry400HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202NonRetry400HeadersInner.java new file mode 100644 index 0000000000..00b5a99055 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202NonRetry400HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202NonRetry400 operation. + */ +public class LROSADsPost202NonRetry400HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPost202NonRetry400HeadersInner object itself. + */ + public LROSADsPost202NonRetry400HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPost202NonRetry400HeadersInner object itself. + */ + public LROSADsPost202NonRetry400HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202RetryInvalidHeaderHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202RetryInvalidHeaderHeadersInner.java new file mode 100644 index 0000000000..a2d4cc3820 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPost202RetryInvalidHeaderHeadersInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202RetryInvalidHeader operation. + */ +public class LROSADsPost202RetryInvalidHeaderHeadersInner { + /** + * Location to poll for result status: will be set to /foo. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to /bar. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPost202RetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsPost202RetryInvalidHeaderHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPost202RetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsPost202RetryInvalidHeaderHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetry400HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetry400HeadersInner.java new file mode 100644 index 0000000000..739f403deb --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetry400HeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetry400 operation. + */ +public class LROSADsPostAsyncRelativeRetry400HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/putasync/retry/operationResults/400. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/putasync/retry/operationResults/400. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPostAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetry400HeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetry400HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetry400HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner.java new file mode 100644 index 0000000000..2a143fba6f --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetryInvalidHeader operation. + */ +public class LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner { + /** + * Location to poll for result status: will be set to foo. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to foo. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to /bar. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidHeaderHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner.java new file mode 100644 index 0000000000..f954815639 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetryInvalidJsonPolling operation. + */ +public class LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/error/postasync/retry/failed/operationResults/invalidjsonpolling. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/error/postasync/retry/failed/operationResults/invalidjsonpolling. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryInvalidJsonPollingHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner.java new file mode 100644 index 0000000000..19d45868ed --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRelativeRetryNoPayload operation. + */ +public class LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/error/putasync/retry/failed/operationResults/nopayload. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/error/putasync/retry/failed/operationResults/nopayload. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner object itself. + */ + public LROSADsPostAsyncRelativeRetryNoPayloadHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostNonRetry400HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostNonRetry400HeadersInner.java new file mode 100644 index 0000000000..26bed7c091 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPostNonRetry400HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postNonRetry400 operation. + */ +public class LROSADsPostNonRetry400HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/retryerror/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPostNonRetry400HeadersInner object itself. + */ + public LROSADsPostNonRetry400HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPostNonRetry400HeadersInner object itself. + */ + public LROSADsPostNonRetry400HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetry400HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetry400HeadersInner.java new file mode 100644 index 0000000000..32d73dc37e --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetry400HeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetry400 operation. + */ +public class LROSADsPutAsyncRelativeRetry400HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/putasync/retry/operationResults/400. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/nonretryerror/putasync/retry/operationResults/400. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetry400HeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetry400HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetry400HeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetry400HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner.java new file mode 100644 index 0000000000..38ffc0a1f3 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetryInvalidHeader operation. + */ +public class LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidHeaderHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner.java new file mode 100644 index 0000000000..080d046cbc --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetryInvalidJsonPolling operation. + */ +public class LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryInvalidJsonPollingHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryNoStatusHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryNoStatusHeadersInner.java new file mode 100644 index 0000000000..f4676d5f0c --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryNoStatusHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetryNoStatus operation. + */ +public class LROSADsPutAsyncRelativeRetryNoStatusHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner.java new file mode 100644 index 0000000000..73ad82259e --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRelativeRetryNoStatusPayload operation. + */ +public class LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner object itself. + */ + public LROSADsPutAsyncRelativeRetryNoStatusPayloadHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPost202Retry200HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPost202Retry200HeadersInner.java new file mode 100644 index 0000000000..0992df5911 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPost202Retry200HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202Retry200 operation. + */ +public class LROsCustomHeaderPost202Retry200HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/customheader/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsCustomHeaderPost202Retry200HeadersInner object itself. + */ + public LROsCustomHeaderPost202Retry200HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsCustomHeaderPost202Retry200HeadersInner object itself. + */ + public LROsCustomHeaderPost202Retry200HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPostAsyncRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPostAsyncRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..f8fa7f3d44 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPostAsyncRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRetrySucceeded operation. + */ +public class LROsCustomHeaderPostAsyncRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/customheader/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/customheader/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsCustomHeaderPostAsyncRetrySucceededHeadersInner object itself. + */ + public LROsCustomHeaderPostAsyncRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsCustomHeaderPostAsyncRetrySucceededHeadersInner object itself. + */ + public LROsCustomHeaderPostAsyncRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsCustomHeaderPostAsyncRetrySucceededHeadersInner object itself. + */ + public LROsCustomHeaderPostAsyncRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPutAsyncRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPutAsyncRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..1959029854 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeaderPutAsyncRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRetrySucceeded operation. + */ +public class LROsCustomHeaderPutAsyncRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/customheader/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/customheader/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsCustomHeaderPutAsyncRetrySucceededHeadersInner object itself. + */ + public LROsCustomHeaderPutAsyncRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsCustomHeaderPutAsyncRetrySucceededHeadersInner object itself. + */ + public LROsCustomHeaderPutAsyncRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsCustomHeaderPutAsyncRetrySucceededHeadersInner object itself. + */ + public LROsCustomHeaderPutAsyncRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeadersInner.java new file mode 100644 index 0000000000..23655e2b7d --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsCustomHeadersInner.java @@ -0,0 +1,1021 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROsCustomHeaders. + */ +public class LROsCustomHeadersInner { + /** The Retrofit service to perform REST calls. */ + private LROsCustomHeadersService service; + /** The service client containing this operation class. */ + private AutoRestLongRunningOperationTestServiceImpl client; + + /** + * Initializes an instance of LROsCustomHeadersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LROsCustomHeadersInner(Retrofit retrofit, AutoRestLongRunningOperationTestServiceImpl client) { + this.service = retrofit.create(LROsCustomHeadersService.class); + this.client = client; + } + + /** + * The interface defining all the services for LROsCustomHeaders to be + * used by Retrofit to perform actually REST calls. + */ + interface LROsCustomHeadersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders putAsyncRetrySucceeded" }) + @PUT("lro/customheader/putasync/retry/succeeded") + Observable> putAsyncRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders beginPutAsyncRetrySucceeded" }) + @PUT("lro/customheader/putasync/retry/succeeded") + Observable> beginPutAsyncRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders put201CreatingSucceeded200" }) + @PUT("lro/customheader/put/201/creating/succeeded/200") + Observable> put201CreatingSucceeded200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders beginPut201CreatingSucceeded200" }) + @PUT("lro/customheader/put/201/creating/succeeded/200") + Observable> beginPut201CreatingSucceeded200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders post202Retry200" }) + @POST("lro/customheader/post/202/retry/200") + Observable> post202Retry200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders beginPost202Retry200" }) + @POST("lro/customheader/post/202/retry/200") + Observable> beginPost202Retry200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders postAsyncRetrySucceeded" }) + @POST("lro/customheader/postasync/retry/succeeded") + Observable> postAsyncRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROsCustomHeaders beginPostAsyncRetrySucceeded" }) + @POST("lro/customheader/postasync/retry/succeeded") + Observable> beginPostAsyncRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRetrySucceeded() { + return putAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetrySucceededAsync() { + return putAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPutAsyncRetrySucceededHeadersInner.class); + } + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRetrySucceeded(ProductInner product) { + return putAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetrySucceededAsync(ProductInner product) { + return putAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPutAsyncRetrySucceededHeadersInner.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRetrySucceeded() { + return beginPutAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRetrySucceededAsync() { + return beginPutAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRetrySucceeded(ProductInner product) { + return beginPutAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRetrySucceededAsync(ProductInner product) { + return beginPutAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsCustomHeaderPutAsyncRetrySucceededHeadersInner.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put201CreatingSucceeded200() { + return put201CreatingSucceeded200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async() { + return put201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put201CreatingSucceeded200(ProductInner product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async(ProductInner product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut201CreatingSucceeded200() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut201CreatingSucceeded200Async() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut201CreatingSucceeded200(ProductInner product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut201CreatingSucceeded200Async(ProductInner product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut201CreatingSucceeded200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200() { + post202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async() { + return post202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPost202Retry200HeadersInner.class); + } + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200(ProductInner product) { + post202Retry200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async(ProductInner product) { + return post202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPost202Retry200HeadersInner.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200() { + beginPost202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async() { + return beginPost202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200(ProductInner product) { + beginPost202Retry200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async(ProductInner product) { + return beginPost202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsCustomHeaderPost202Retry200HeadersInner.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetrySucceeded() { + postAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrySucceededAsync() { + return postAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPostAsyncRetrySucceededHeadersInner.class); + } + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetrySucceeded(ProductInner product) { + postAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrySucceededAsync(ProductInner product) { + return postAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsCustomHeaderPostAsyncRetrySucceededHeadersInner.class); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetrySucceeded() { + beginPostAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetrySucceededAsync() { + return beginPostAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetrySucceeded(ProductInner product) { + beginPostAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetrySucceededAsync(ProductInner product) { + return beginPostAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 is required message header for all requests. Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsCustomHeaderPostAsyncRetrySucceededHeadersInner.class); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDelete202NoRetry204HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDelete202NoRetry204HeadersInner.java new file mode 100644 index 0000000000..b5f8598031 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDelete202NoRetry204HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202NoRetry204 operation. + */ +public class LROsDelete202NoRetry204HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/delete/202/noretry/204. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDelete202NoRetry204HeadersInner object itself. + */ + public LROsDelete202NoRetry204HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDelete202NoRetry204HeadersInner object itself. + */ + public LROsDelete202NoRetry204HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDelete202Retry200HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDelete202Retry200HeadersInner.java new file mode 100644 index 0000000000..67db41a095 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDelete202Retry200HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete202Retry200 operation. + */ +public class LROsDelete202Retry200HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/delete/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDelete202Retry200HeadersInner object itself. + */ + public LROsDelete202Retry200HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDelete202Retry200HeadersInner object itself. + */ + public LROsDelete202Retry200HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncNoHeaderInRetryHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncNoHeaderInRetryHeadersInner.java new file mode 100644 index 0000000000..c7f2005b5c --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncNoHeaderInRetryHeadersInner.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncNoHeaderInRetry operation. + */ +public class LROsDeleteAsyncNoHeaderInRetryHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/put/noheader/202/204/operationresults. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncNoHeaderInRetryHeadersInner object itself. + */ + public LROsDeleteAsyncNoHeaderInRetryHeadersInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncNoRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncNoRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..831ed7e363 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncNoRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncNoRetrySucceeded operation. + */ +public class LROsDeleteAsyncNoRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/noretry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/noretry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsDeleteAsyncNoRetrySucceededHeadersInner object itself. + */ + public LROsDeleteAsyncNoRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncNoRetrySucceededHeadersInner object itself. + */ + public LROsDeleteAsyncNoRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteAsyncNoRetrySucceededHeadersInner object itself. + */ + public LROsDeleteAsyncNoRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetryFailedHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetryFailedHeadersInner.java new file mode 100644 index 0000000000..182a146620 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetryFailedHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRetryFailed operation. + */ +public class LROsDeleteAsyncRetryFailedHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsDeleteAsyncRetryFailedHeadersInner object itself. + */ + public LROsDeleteAsyncRetryFailedHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncRetryFailedHeadersInner object itself. + */ + public LROsDeleteAsyncRetryFailedHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteAsyncRetryFailedHeadersInner object itself. + */ + public LROsDeleteAsyncRetryFailedHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..a07ff4d1cb --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRetrySucceeded operation. + */ +public class LROsDeleteAsyncRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsDeleteAsyncRetrySucceededHeadersInner object itself. + */ + public LROsDeleteAsyncRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncRetrySucceededHeadersInner object itself. + */ + public LROsDeleteAsyncRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteAsyncRetrySucceededHeadersInner object itself. + */ + public LROsDeleteAsyncRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetrycanceledHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetrycanceledHeadersInner.java new file mode 100644 index 0000000000..fe46621b83 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteAsyncRetrycanceledHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteAsyncRetrycanceled operation. + */ +public class LROsDeleteAsyncRetrycanceledHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/canceled/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/deleteasync/retry/canceled/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsDeleteAsyncRetrycanceledHeadersInner object itself. + */ + public LROsDeleteAsyncRetrycanceledHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteAsyncRetrycanceledHeadersInner object itself. + */ + public LROsDeleteAsyncRetrycanceledHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteAsyncRetrycanceledHeadersInner object itself. + */ + public LROsDeleteAsyncRetrycanceledHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteNoHeaderInRetryHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteNoHeaderInRetryHeadersInner.java new file mode 100644 index 0000000000..25221164d4 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteNoHeaderInRetryHeadersInner.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteNoHeaderInRetry operation. + */ +public class LROsDeleteNoHeaderInRetryHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/put/noheader/202/204/operationresults. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteNoHeaderInRetryHeadersInner object itself. + */ + public LROsDeleteNoHeaderInRetryHeadersInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202Accepted200SucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202Accepted200SucceededHeadersInner.java new file mode 100644 index 0000000000..2c26262fae --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202Accepted200SucceededHeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteProvisioning202Accepted200Succeeded operation. + */ +public class LROsDeleteProvisioning202Accepted200SucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/delete/provisioning/202/accepted/200/succeeded. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteProvisioning202Accepted200SucceededHeadersInner object itself. + */ + public LROsDeleteProvisioning202Accepted200SucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteProvisioning202Accepted200SucceededHeadersInner object itself. + */ + public LROsDeleteProvisioning202Accepted200SucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202DeletingFailed200HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202DeletingFailed200HeadersInner.java new file mode 100644 index 0000000000..531151df77 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202DeletingFailed200HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteProvisioning202DeletingFailed200 operation. + */ +public class LROsDeleteProvisioning202DeletingFailed200HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/delete/provisioning/202/deleting/200/failed. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteProvisioning202DeletingFailed200HeadersInner object itself. + */ + public LROsDeleteProvisioning202DeletingFailed200HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteProvisioning202DeletingFailed200HeadersInner object itself. + */ + public LROsDeleteProvisioning202DeletingFailed200HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202Deletingcanceled200HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202Deletingcanceled200HeadersInner.java new file mode 100644 index 0000000000..ac972d20a1 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsDeleteProvisioning202Deletingcanceled200HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for deleteProvisioning202Deletingcanceled200 operation. + */ +public class LROsDeleteProvisioning202Deletingcanceled200HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/delete/provisioning/202/deleting/200/canceled. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsDeleteProvisioning202Deletingcanceled200HeadersInner object itself. + */ + public LROsDeleteProvisioning202Deletingcanceled200HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsDeleteProvisioning202Deletingcanceled200HeadersInner object itself. + */ + public LROsDeleteProvisioning202Deletingcanceled200HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsInner.java new file mode 100644 index 0000000000..4ec16a2e9c --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsInner.java @@ -0,0 +1,7213 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in LROs. + */ +public class LROsInner { + /** The Retrofit service to perform REST calls. */ + private LROsService service; + /** The service client containing this operation class. */ + private AutoRestLongRunningOperationTestServiceImpl client; + + /** + * Initializes an instance of LROsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LROsInner(Retrofit retrofit, AutoRestLongRunningOperationTestServiceImpl client) { + this.service = retrofit.create(LROsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LROs to be + * used by Retrofit to perform actually REST calls. + */ + interface LROsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put200Succeeded" }) + @PUT("lro/put/200/succeeded") + Observable> put200Succeeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut200Succeeded" }) + @PUT("lro/put/200/succeeded") + Observable> beginPut200Succeeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put200SucceededNoState" }) + @PUT("lro/put/200/succeeded/nostate") + Observable> put200SucceededNoState(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut200SucceededNoState" }) + @PUT("lro/put/200/succeeded/nostate") + Observable> beginPut200SucceededNoState(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put202Retry200" }) + @PUT("lro/put/202/retry/200") + Observable> put202Retry200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut202Retry200" }) + @PUT("lro/put/202/retry/200") + Observable> beginPut202Retry200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put201CreatingSucceeded200" }) + @PUT("lro/put/201/creating/succeeded/200") + Observable> put201CreatingSucceeded200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut201CreatingSucceeded200" }) + @PUT("lro/put/201/creating/succeeded/200") + Observable> beginPut201CreatingSucceeded200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put200UpdatingSucceeded204" }) + @PUT("lro/put/200/updating/succeeded/200") + Observable> put200UpdatingSucceeded204(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut200UpdatingSucceeded204" }) + @PUT("lro/put/200/updating/succeeded/200") + Observable> beginPut200UpdatingSucceeded204(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put201CreatingFailed200" }) + @PUT("lro/put/201/created/failed/200") + Observable> put201CreatingFailed200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut201CreatingFailed200" }) + @PUT("lro/put/201/created/failed/200") + Observable> beginPut201CreatingFailed200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs put200Acceptedcanceled200" }) + @PUT("lro/put/200/accepted/canceled/200") + Observable> put200Acceptedcanceled200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPut200Acceptedcanceled200" }) + @PUT("lro/put/200/accepted/canceled/200") + Observable> beginPut200Acceptedcanceled200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putNoHeaderInRetry" }) + @PUT("lro/put/noheader/202/200") + Observable> putNoHeaderInRetry(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutNoHeaderInRetry" }) + @PUT("lro/put/noheader/202/200") + Observable> beginPutNoHeaderInRetry(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncRetrySucceeded" }) + @PUT("lro/putasync/retry/succeeded") + Observable> putAsyncRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncRetrySucceeded" }) + @PUT("lro/putasync/retry/succeeded") + Observable> beginPutAsyncRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncNoRetrySucceeded" }) + @PUT("lro/putasync/noretry/succeeded") + Observable> putAsyncNoRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncNoRetrySucceeded" }) + @PUT("lro/putasync/noretry/succeeded") + Observable> beginPutAsyncNoRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncRetryFailed" }) + @PUT("lro/putasync/retry/failed") + Observable> putAsyncRetryFailed(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncRetryFailed" }) + @PUT("lro/putasync/retry/failed") + Observable> beginPutAsyncRetryFailed(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncNoRetrycanceled" }) + @PUT("lro/putasync/noretry/canceled") + Observable> putAsyncNoRetrycanceled(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncNoRetrycanceled" }) + @PUT("lro/putasync/noretry/canceled") + Observable> beginPutAsyncNoRetrycanceled(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncNoHeaderInRetry" }) + @PUT("lro/putasync/noheader/201/200") + Observable> putAsyncNoHeaderInRetry(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncNoHeaderInRetry" }) + @PUT("lro/putasync/noheader/201/200") + Observable> beginPutAsyncNoHeaderInRetry(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putNonResource" }) + @PUT("lro/putnonresource/202/200") + Observable> putNonResource(@Body SkuInner sku, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutNonResource" }) + @PUT("lro/putnonresource/202/200") + Observable> beginPutNonResource(@Body SkuInner sku, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncNonResource" }) + @PUT("lro/putnonresourceasync/202/200") + Observable> putAsyncNonResource(@Body SkuInner sku, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncNonResource" }) + @PUT("lro/putnonresourceasync/202/200") + Observable> beginPutAsyncNonResource(@Body SkuInner sku, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putSubResource" }) + @PUT("lro/putsubresource/202/200") + Observable> putSubResource(@Body SubProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutSubResource" }) + @PUT("lro/putsubresource/202/200") + Observable> beginPutSubResource(@Body SubProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs putAsyncSubResource" }) + @PUT("lro/putsubresourceasync/202/200") + Observable> putAsyncSubResource(@Body SubProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPutAsyncSubResource" }) + @PUT("lro/putsubresourceasync/202/200") + Observable> beginPutAsyncSubResource(@Body SubProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteProvisioning202Accepted200Succeeded" }) + @HTTP(path = "lro/delete/provisioning/202/accepted/200/succeeded", method = "DELETE", hasBody = true) + Observable> deleteProvisioning202Accepted200Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteProvisioning202Accepted200Succeeded" }) + @HTTP(path = "lro/delete/provisioning/202/accepted/200/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteProvisioning202Accepted200Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteProvisioning202DeletingFailed200" }) + @HTTP(path = "lro/delete/provisioning/202/deleting/200/failed", method = "DELETE", hasBody = true) + Observable> deleteProvisioning202DeletingFailed200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteProvisioning202DeletingFailed200" }) + @HTTP(path = "lro/delete/provisioning/202/deleting/200/failed", method = "DELETE", hasBody = true) + Observable> beginDeleteProvisioning202DeletingFailed200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteProvisioning202Deletingcanceled200" }) + @HTTP(path = "lro/delete/provisioning/202/deleting/200/canceled", method = "DELETE", hasBody = true) + Observable> deleteProvisioning202Deletingcanceled200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteProvisioning202Deletingcanceled200" }) + @HTTP(path = "lro/delete/provisioning/202/deleting/200/canceled", method = "DELETE", hasBody = true) + Observable> beginDeleteProvisioning202Deletingcanceled200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs delete204Succeeded" }) + @HTTP(path = "lro/delete/204/succeeded", method = "DELETE", hasBody = true) + Observable> delete204Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDelete204Succeeded" }) + @HTTP(path = "lro/delete/204/succeeded", method = "DELETE", hasBody = true) + Observable> beginDelete204Succeeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs delete202Retry200" }) + @HTTP(path = "lro/delete/202/retry/200", method = "DELETE", hasBody = true) + Observable> delete202Retry200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDelete202Retry200" }) + @HTTP(path = "lro/delete/202/retry/200", method = "DELETE", hasBody = true) + Observable> beginDelete202Retry200(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs delete202NoRetry204" }) + @HTTP(path = "lro/delete/202/noretry/204", method = "DELETE", hasBody = true) + Observable> delete202NoRetry204(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDelete202NoRetry204" }) + @HTTP(path = "lro/delete/202/noretry/204", method = "DELETE", hasBody = true) + Observable> beginDelete202NoRetry204(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteNoHeaderInRetry" }) + @HTTP(path = "lro/delete/noheader", method = "DELETE", hasBody = true) + Observable> deleteNoHeaderInRetry(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteNoHeaderInRetry" }) + @HTTP(path = "lro/delete/noheader", method = "DELETE", hasBody = true) + Observable> beginDeleteNoHeaderInRetry(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncNoHeaderInRetry" }) + @HTTP(path = "lro/deleteasync/noheader/202/204", method = "DELETE", hasBody = true) + Observable> deleteAsyncNoHeaderInRetry(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncNoHeaderInRetry" }) + @HTTP(path = "lro/deleteasync/noheader/202/204", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncNoHeaderInRetry(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncRetrySucceeded" }) + @HTTP(path = "lro/deleteasync/retry/succeeded", method = "DELETE", hasBody = true) + Observable> deleteAsyncRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncRetrySucceeded" }) + @HTTP(path = "lro/deleteasync/retry/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncNoRetrySucceeded" }) + @HTTP(path = "lro/deleteasync/noretry/succeeded", method = "DELETE", hasBody = true) + Observable> deleteAsyncNoRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncNoRetrySucceeded" }) + @HTTP(path = "lro/deleteasync/noretry/succeeded", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncNoRetrySucceeded(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncRetryFailed" }) + @HTTP(path = "lro/deleteasync/retry/failed", method = "DELETE", hasBody = true) + Observable> deleteAsyncRetryFailed(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncRetryFailed" }) + @HTTP(path = "lro/deleteasync/retry/failed", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRetryFailed(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs deleteAsyncRetrycanceled" }) + @HTTP(path = "lro/deleteasync/retry/canceled", method = "DELETE", hasBody = true) + Observable> deleteAsyncRetrycanceled(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginDeleteAsyncRetrycanceled" }) + @HTTP(path = "lro/deleteasync/retry/canceled", method = "DELETE", hasBody = true) + Observable> beginDeleteAsyncRetrycanceled(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs post200WithPayload" }) + @POST("lro/post/payload/200") + Observable> post200WithPayload(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPost200WithPayload" }) + @POST("lro/post/payload/200") + Observable> beginPost200WithPayload(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs post202Retry200" }) + @POST("lro/post/202/retry/200") + Observable> post202Retry200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPost202Retry200" }) + @POST("lro/post/202/retry/200") + Observable> beginPost202Retry200(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs post202NoRetry204" }) + @POST("lro/post/202/noretry/204") + Observable> post202NoRetry204(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPost202NoRetry204" }) + @POST("lro/post/202/noretry/204") + Observable> beginPost202NoRetry204(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs postAsyncRetrySucceeded" }) + @POST("lro/postasync/retry/succeeded") + Observable> postAsyncRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPostAsyncRetrySucceeded" }) + @POST("lro/postasync/retry/succeeded") + Observable> beginPostAsyncRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs postAsyncNoRetrySucceeded" }) + @POST("lro/postasync/noretry/succeeded") + Observable> postAsyncNoRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPostAsyncNoRetrySucceeded" }) + @POST("lro/postasync/noretry/succeeded") + Observable> beginPostAsyncNoRetrySucceeded(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs postAsyncRetryFailed" }) + @POST("lro/postasync/retry/failed") + Observable> postAsyncRetryFailed(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPostAsyncRetryFailed" }) + @POST("lro/postasync/retry/failed") + Observable> beginPostAsyncRetryFailed(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs postAsyncRetrycanceled" }) + @POST("lro/postasync/retry/canceled") + Observable> postAsyncRetrycanceled(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.lro.LROs beginPostAsyncRetrycanceled" }) + @POST("lro/postasync/retry/canceled") + Observable> beginPostAsyncRetrycanceled(@Body ProductInner product, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200Succeeded() { + return put200SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200SucceededAsync() { + return put200SucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200SucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put200Succeeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200Succeeded(ProductInner product) { + return put200SucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200SucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200SucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200SucceededAsync(ProductInner product) { + return put200SucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200SucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put200Succeeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200Succeeded() { + return beginPut200SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200SucceededAsync() { + return beginPut200SucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200SucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut200Succeeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200Succeeded(ProductInner product) { + return beginPut200SucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200SucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200SucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200SucceededAsync(ProductInner product) { + return beginPut200SucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200SucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut200Succeeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200SucceededNoState() { + return put200SucceededNoStateWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200SucceededNoStateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200SucceededNoStateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200SucceededNoStateAsync() { + return put200SucceededNoStateWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200SucceededNoStateWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put200SucceededNoState(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200SucceededNoState(ProductInner product) { + return put200SucceededNoStateWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200SucceededNoStateAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200SucceededNoStateWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200SucceededNoStateAsync(ProductInner product) { + return put200SucceededNoStateWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200SucceededNoStateWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put200SucceededNoState(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200SucceededNoState() { + return beginPut200SucceededNoStateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200SucceededNoStateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200SucceededNoStateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200SucceededNoStateAsync() { + return beginPut200SucceededNoStateWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200SucceededNoStateWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut200SucceededNoState(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200SucceededNoStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200SucceededNoState(ProductInner product) { + return beginPut200SucceededNoStateWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200SucceededNoStateAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200SucceededNoStateWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200SucceededNoStateAsync(ProductInner product) { + return beginPut200SucceededNoStateWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that does not contain ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200SucceededNoStateWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut200SucceededNoState(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200SucceededNoStateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200SucceededNoStateDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put202Retry200() { + return put202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put202Retry200Async() { + return put202Retry200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put202Retry200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put202Retry200(ProductInner product) { + return put202Retry200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put202Retry200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put202Retry200Async(ProductInner product) { + return put202Retry200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put202Retry200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut202Retry200() { + return beginPut202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut202Retry200Async() { + return beginPut202Retry200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut202Retry200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut202Retry200(ProductInner product) { + return beginPut202Retry200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut202Retry200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut202Retry200Async(ProductInner product) { + return beginPut202Retry200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request, with a location header that points to a polling URL that returns a 200 and an entity that doesn't contains ProvisioningState. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut202Retry200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put201CreatingSucceeded200() { + return put201CreatingSucceeded200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async() { + return put201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put201CreatingSucceeded200(ProductInner product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingSucceeded200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingSucceeded200Async(ProductInner product) { + return put201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingSucceeded200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut201CreatingSucceeded200() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut201CreatingSucceeded200Async() { + return beginPut201CreatingSucceeded200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut201CreatingSucceeded200(ProductInner product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingSucceeded200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingSucceeded200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut201CreatingSucceeded200Async(ProductInner product) { + return beginPut201CreatingSucceeded200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut201CreatingSucceeded200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut201CreatingSucceeded200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingSucceeded200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut201CreatingSucceeded200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200UpdatingSucceeded204() { + return put200UpdatingSucceeded204WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200UpdatingSucceeded204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200UpdatingSucceeded204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200UpdatingSucceeded204Async() { + return put200UpdatingSucceeded204WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200UpdatingSucceeded204WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put200UpdatingSucceeded204(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200UpdatingSucceeded204(ProductInner product) { + return put200UpdatingSucceeded204WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200UpdatingSucceeded204Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200UpdatingSucceeded204WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200UpdatingSucceeded204Async(ProductInner product) { + return put200UpdatingSucceeded204WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200UpdatingSucceeded204WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put200UpdatingSucceeded204(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200UpdatingSucceeded204() { + return beginPut200UpdatingSucceeded204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200UpdatingSucceeded204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200UpdatingSucceeded204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200UpdatingSucceeded204Async() { + return beginPut200UpdatingSucceeded204WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200UpdatingSucceeded204WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut200UpdatingSucceeded204(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200UpdatingSucceeded204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200UpdatingSucceeded204(ProductInner product) { + return beginPut200UpdatingSucceeded204WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200UpdatingSucceeded204Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200UpdatingSucceeded204WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200UpdatingSucceeded204Async(ProductInner product) { + return beginPut200UpdatingSucceeded204WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Updating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200UpdatingSucceeded204WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut200UpdatingSucceeded204(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200UpdatingSucceeded204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200UpdatingSucceeded204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put201CreatingFailed200() { + return put201CreatingFailed200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingFailed200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingFailed200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingFailed200Async() { + return put201CreatingFailed200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingFailed200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put201CreatingFailed200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put201CreatingFailed200(ProductInner product) { + return put201CreatingFailed200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201CreatingFailed200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201CreatingFailed200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put201CreatingFailed200Async(ProductInner product) { + return put201CreatingFailed200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put201CreatingFailed200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put201CreatingFailed200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut201CreatingFailed200() { + return beginPut201CreatingFailed200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingFailed200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingFailed200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut201CreatingFailed200Async() { + return beginPut201CreatingFailed200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut201CreatingFailed200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut201CreatingFailed200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingFailed200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut201CreatingFailed200(ProductInner product) { + return beginPut201CreatingFailed200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut201CreatingFailed200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut201CreatingFailed200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut201CreatingFailed200Async(ProductInner product) { + return beginPut201CreatingFailed200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Created’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut201CreatingFailed200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut201CreatingFailed200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut201CreatingFailed200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut201CreatingFailed200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200Acceptedcanceled200() { + return put200Acceptedcanceled200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200Acceptedcanceled200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200Acceptedcanceled200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200Acceptedcanceled200Async() { + return put200Acceptedcanceled200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200Acceptedcanceled200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.put200Acceptedcanceled200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner put200Acceptedcanceled200(ProductInner product) { + return put200Acceptedcanceled200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200Acceptedcanceled200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200Acceptedcanceled200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable put200Acceptedcanceled200Async(ProductInner product) { + return put200Acceptedcanceled200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> put200Acceptedcanceled200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.put200Acceptedcanceled200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200Acceptedcanceled200() { + return beginPut200Acceptedcanceled200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200Acceptedcanceled200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200Acceptedcanceled200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200Acceptedcanceled200Async() { + return beginPut200Acceptedcanceled200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200Acceptedcanceled200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPut200Acceptedcanceled200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200Acceptedcanceled200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPut200Acceptedcanceled200(ProductInner product) { + return beginPut200Acceptedcanceled200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPut200Acceptedcanceled200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPut200Acceptedcanceled200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPut200Acceptedcanceled200Async(ProductInner product) { + return beginPut200Acceptedcanceled200WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 201 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPut200Acceptedcanceled200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPut200Acceptedcanceled200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPut200Acceptedcanceled200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPut200Acceptedcanceled200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putNoHeaderInRetry() { + return putNoHeaderInRetryWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNoHeaderInRetryAsync() { + return putNoHeaderInRetryWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNoHeaderInRetryWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutNoHeaderInRetryHeadersInner.class); + } + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putNoHeaderInRetry(ProductInner product) { + return putNoHeaderInRetryWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNoHeaderInRetryAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putNoHeaderInRetryWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNoHeaderInRetryAsync(ProductInner product) { + return putNoHeaderInRetryWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNoHeaderInRetryWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutNoHeaderInRetryHeadersInner.class); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutNoHeaderInRetry() { + return beginPutNoHeaderInRetryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutNoHeaderInRetryAsync() { + return beginPutNoHeaderInRetryWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutNoHeaderInRetryWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutNoHeaderInRetry(ProductInner product) { + return beginPutNoHeaderInRetryWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNoHeaderInRetryAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutNoHeaderInRetryWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutNoHeaderInRetryAsync(ProductInner product) { + return beginPutNoHeaderInRetryWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with location header. Subsequent calls to operation status do not contain location header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutNoHeaderInRetryWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutNoHeaderInRetryDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutNoHeaderInRetryHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRetrySucceeded() { + return putAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetrySucceededAsync() { + return putAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncRetrySucceededHeadersInner.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRetrySucceeded(ProductInner product) { + return putAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetrySucceededAsync(ProductInner product) { + return putAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncRetrySucceededHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRetrySucceeded() { + return beginPutAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRetrySucceededAsync() { + return beginPutAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRetrySucceeded(ProductInner product) { + return beginPutAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRetrySucceededAsync(ProductInner product) { + return beginPutAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncRetrySucceededHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncNoRetrySucceeded() { + return putAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoRetrySucceededAsync() { + return putAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoRetrySucceededHeadersInner.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncNoRetrySucceeded(ProductInner product) { + return putAsyncNoRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoRetrySucceededAsync(ProductInner product) { + return putAsyncNoRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoRetrySucceededHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncNoRetrySucceeded() { + return beginPutAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncNoRetrySucceededAsync() { + return beginPutAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncNoRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncNoRetrySucceeded(ProductInner product) { + return beginPutAsyncNoRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncNoRetrySucceededAsync(ProductInner product) { + return beginPutAsyncNoRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncNoRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncNoRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncNoRetrySucceededHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRetryFailed() { + return putAsyncRetryFailedWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetryFailedAsync() { + return putAsyncRetryFailedWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetryFailedWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncRetryFailedHeadersInner.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncRetryFailed(ProductInner product) { + return putAsyncRetryFailedWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncRetryFailedAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncRetryFailedWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncRetryFailedAsync(ProductInner product) { + return putAsyncRetryFailedWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncRetryFailedWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncRetryFailedHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRetryFailed() { + return beginPutAsyncRetryFailedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRetryFailedAsync() { + return beginPutAsyncRetryFailedWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRetryFailedWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncRetryFailed(ProductInner product) { + return beginPutAsyncRetryFailedWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncRetryFailedAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncRetryFailedWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncRetryFailedAsync(ProductInner product) { + return beginPutAsyncRetryFailedWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncRetryFailedWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncRetryFailedDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncRetryFailedHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncNoRetrycanceled() { + return putAsyncNoRetrycanceledWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoRetrycanceledAsync() { + return putAsyncNoRetrycanceledWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoRetrycanceledWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncNoRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoRetrycanceledHeadersInner.class); + } + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncNoRetrycanceled(ProductInner product) { + return putAsyncNoRetrycanceledWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoRetrycanceledAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoRetrycanceledWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoRetrycanceledAsync(ProductInner product) { + return putAsyncNoRetrycanceledWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoRetrycanceledWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncNoRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoRetrycanceledHeadersInner.class); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncNoRetrycanceled() { + return beginPutAsyncNoRetrycanceledWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncNoRetrycanceledAsync() { + return beginPutAsyncNoRetrycanceledWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncNoRetrycanceledWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncNoRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncNoRetrycanceled(ProductInner product) { + return beginPutAsyncNoRetrycanceledWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoRetrycanceledAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoRetrycanceledWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncNoRetrycanceledAsync(ProductInner product) { + return beginPutAsyncNoRetrycanceledWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 200 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncNoRetrycanceledWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncNoRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncNoRetrycanceledDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncNoRetrycanceledHeadersInner.class); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncNoHeaderInRetry() { + return putAsyncNoHeaderInRetryWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoHeaderInRetryAsync() { + return putAsyncNoHeaderInRetryWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoHeaderInRetryWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.putAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoHeaderInRetryHeadersInner.class); + } + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner putAsyncNoHeaderInRetry(ProductInner product) { + return putAsyncNoHeaderInRetryWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNoHeaderInRetryAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(putAsyncNoHeaderInRetryWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNoHeaderInRetryAsync(ProductInner product) { + return putAsyncNoHeaderInRetryWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNoHeaderInRetryWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPutAsyncNoHeaderInRetryHeadersInner.class); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncNoHeaderInRetry() { + return beginPutAsyncNoHeaderInRetryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncNoHeaderInRetryAsync() { + return beginPutAsyncNoHeaderInRetryWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncNoHeaderInRetryWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPutAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPutAsyncNoHeaderInRetry(ProductInner product) { + return beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNoHeaderInRetryAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPutAsyncNoHeaderInRetryAsync(ProductInner product) { + return beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running put request, service returns a 202 to the initial request with Azure-AsyncOperation header. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPutAsyncNoHeaderInRetryWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPutAsyncNoHeaderInRetry(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPutAsyncNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPutAsyncNoHeaderInRetryDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPutAsyncNoHeaderInRetryHeadersInner.class); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner putNonResource() { + return putNonResourceWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonResourceAsync() { + return putNonResourceWithServiceResponseAsync().map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonResourceWithServiceResponseAsync() { + final SkuInner sku = null; + Observable> observable = service.putNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner putNonResource(SkuInner sku) { + return putNonResourceWithServiceResponseAsync(sku).toBlocking().last().body(); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonResourceAsync(SkuInner sku, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonResourceWithServiceResponseAsync(sku), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putNonResourceAsync(SkuInner sku) { + return putNonResourceWithServiceResponseAsync(sku).map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putNonResourceWithServiceResponseAsync(SkuInner sku) { + Validator.validate(sku); + Observable> observable = service.putNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner beginPutNonResource() { + return beginPutNonResourceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable beginPutNonResourceAsync() { + return beginPutNonResourceWithServiceResponseAsync().map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable> beginPutNonResourceWithServiceResponseAsync() { + final SkuInner sku = null; + return service.beginPutNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner beginPutNonResource(SkuInner sku) { + return beginPutNonResourceWithServiceResponseAsync(sku).toBlocking().single().body(); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutNonResourceAsync(SkuInner sku, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutNonResourceWithServiceResponseAsync(sku), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable beginPutNonResourceAsync(SkuInner sku) { + return beginPutNonResourceWithServiceResponseAsync(sku).map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable> beginPutNonResourceWithServiceResponseAsync(SkuInner sku) { + Validator.validate(sku); + return service.beginPutNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutNonResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutNonResourceDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner putAsyncNonResource() { + return putAsyncNonResourceWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNonResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putAsyncNonResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNonResourceAsync() { + return putAsyncNonResourceWithServiceResponseAsync().map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNonResourceWithServiceResponseAsync() { + final SkuInner sku = null; + Observable> observable = service.putAsyncNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner putAsyncNonResource(SkuInner sku) { + return putAsyncNonResourceWithServiceResponseAsync(sku).toBlocking().last().body(); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncNonResourceAsync(SkuInner sku, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putAsyncNonResourceWithServiceResponseAsync(sku), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncNonResourceAsync(SkuInner sku) { + return putAsyncNonResourceWithServiceResponseAsync(sku).map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncNonResourceWithServiceResponseAsync(SkuInner sku) { + Validator.validate(sku); + Observable> observable = service.putAsyncNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner beginPutAsyncNonResource() { + return beginPutAsyncNonResourceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request with non resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNonResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutAsyncNonResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable beginPutAsyncNonResourceAsync() { + return beginPutAsyncNonResourceWithServiceResponseAsync().map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable> beginPutAsyncNonResourceWithServiceResponseAsync() { + final SkuInner sku = null; + return service.beginPutAsyncNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutAsyncNonResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner beginPutAsyncNonResource(SkuInner sku) { + return beginPutAsyncNonResourceWithServiceResponseAsync(sku).toBlocking().single().body(); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncNonResourceAsync(SkuInner sku, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutAsyncNonResourceWithServiceResponseAsync(sku), serviceCallback); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable beginPutAsyncNonResourceAsync(SkuInner sku) { + return beginPutAsyncNonResourceWithServiceResponseAsync(sku).map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with non resource. + * + * @param sku Sku to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable> beginPutAsyncNonResourceWithServiceResponseAsync(SkuInner sku) { + Validator.validate(sku); + return service.beginPutAsyncNonResource(sku, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutAsyncNonResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutAsyncNonResourceDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProductInner object if successful. + */ + public SubProductInner putSubResource() { + return putSubResourceWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSubResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSubResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putSubResourceAsync() { + return putSubResourceWithServiceResponseAsync().map(new Func1, SubProductInner>() { + @Override + public SubProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putSubResourceWithServiceResponseAsync() { + final SubProductInner product = null; + Observable> observable = service.putSubResource(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProductInner object if successful. + */ + public SubProductInner putSubResource(SubProductInner product) { + return putSubResourceWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSubResourceAsync(SubProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSubResourceWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putSubResourceAsync(SubProductInner product) { + return putSubResourceWithServiceResponseAsync(product).map(new Func1, SubProductInner>() { + @Override + public SubProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putSubResourceWithServiceResponseAsync(SubProductInner product) { + Validator.validate(product); + Observable> observable = service.putSubResource(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProductInner object if successful. + */ + public SubProductInner beginPutSubResource() { + return beginPutSubResourceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutSubResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutSubResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProductInner object + */ + public Observable beginPutSubResourceAsync() { + return beginPutSubResourceWithServiceResponseAsync().map(new Func1, SubProductInner>() { + @Override + public SubProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProductInner object + */ + public Observable> beginPutSubResourceWithServiceResponseAsync() { + final SubProductInner product = null; + return service.beginPutSubResource(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutSubResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProductInner object if successful. + */ + public SubProductInner beginPutSubResource(SubProductInner product) { + return beginPutSubResourceWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutSubResourceAsync(SubProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutSubResourceWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProductInner object + */ + public Observable beginPutSubResourceAsync(SubProductInner product) { + return beginPutSubResourceWithServiceResponseAsync(product).map(new Func1, SubProductInner>() { + @Override + public SubProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProductInner object + */ + public Observable> beginPutSubResourceWithServiceResponseAsync(SubProductInner product) { + Validator.validate(product); + return service.beginPutSubResource(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutSubResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutSubResourceDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProductInner object if successful. + */ + public SubProductInner putAsyncSubResource() { + return putAsyncSubResourceWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncSubResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putAsyncSubResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncSubResourceAsync() { + return putAsyncSubResourceWithServiceResponseAsync().map(new Func1, SubProductInner>() { + @Override + public SubProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncSubResourceWithServiceResponseAsync() { + final SubProductInner product = null; + Observable> observable = service.putAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProductInner object if successful. + */ + public SubProductInner putAsyncSubResource(SubProductInner product) { + return putAsyncSubResourceWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putAsyncSubResourceAsync(SubProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putAsyncSubResourceWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable putAsyncSubResourceAsync(SubProductInner product) { + return putAsyncSubResourceWithServiceResponseAsync(product).map(new Func1, SubProductInner>() { + @Override + public SubProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> putAsyncSubResourceWithServiceResponseAsync(SubProductInner product) { + Validator.validate(product); + Observable> observable = service.putAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProductInner object if successful. + */ + public SubProductInner beginPutAsyncSubResource() { + return beginPutAsyncSubResourceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running put request with sub resource. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncSubResourceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutAsyncSubResourceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProductInner object + */ + public Observable beginPutAsyncSubResourceAsync() { + return beginPutAsyncSubResourceWithServiceResponseAsync().map(new Func1, SubProductInner>() { + @Override + public SubProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProductInner object + */ + public Observable> beginPutAsyncSubResourceWithServiceResponseAsync() { + final SubProductInner product = null; + return service.beginPutAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutAsyncSubResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SubProductInner object if successful. + */ + public SubProductInner beginPutAsyncSubResource(SubProductInner product) { + return beginPutAsyncSubResourceWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPutAsyncSubResourceAsync(SubProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPutAsyncSubResourceWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProductInner object + */ + public Observable beginPutAsyncSubResourceAsync(SubProductInner product) { + return beginPutAsyncSubResourceWithServiceResponseAsync(product).map(new Func1, SubProductInner>() { + @Override + public SubProductInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running put request with sub resource. + * + * @param product Sub Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SubProductInner object + */ + public Observable> beginPutAsyncSubResourceWithServiceResponseAsync(SubProductInner product) { + Validator.validate(product); + return service.beginPutAsyncSubResource(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPutAsyncSubResourceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPutAsyncSubResourceDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner deleteProvisioning202Accepted200Succeeded() { + return deleteProvisioning202Accepted200SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteProvisioning202Accepted200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteProvisioning202Accepted200SucceededAsync() { + return deleteProvisioning202Accepted200SucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteProvisioning202Accepted200SucceededWithServiceResponseAsync() { + Observable> observable = service.deleteProvisioning202Accepted200Succeeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteProvisioning202Accepted200SucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginDeleteProvisioning202Accepted200Succeeded() { + return beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteProvisioning202Accepted200SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginDeleteProvisioning202Accepted200SucceededAsync() { + return beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Accepted’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginDeleteProvisioning202Accepted200SucceededWithServiceResponseAsync() { + return service.beginDeleteProvisioning202Accepted200Succeeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteProvisioning202Accepted200SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteProvisioning202Accepted200SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteProvisioning202Accepted200SucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner deleteProvisioning202DeletingFailed200() { + return deleteProvisioning202DeletingFailed200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProvisioning202DeletingFailed200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteProvisioning202DeletingFailed200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteProvisioning202DeletingFailed200Async() { + return deleteProvisioning202DeletingFailed200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteProvisioning202DeletingFailed200WithServiceResponseAsync() { + Observable> observable = service.deleteProvisioning202DeletingFailed200(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteProvisioning202DeletingFailed200HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginDeleteProvisioning202DeletingFailed200() { + return beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteProvisioning202DeletingFailed200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginDeleteProvisioning202DeletingFailed200Async() { + return beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Failed’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginDeleteProvisioning202DeletingFailed200WithServiceResponseAsync() { + return service.beginDeleteProvisioning202DeletingFailed200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteProvisioning202DeletingFailed200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteProvisioning202DeletingFailed200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteProvisioning202DeletingFailed200HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner deleteProvisioning202Deletingcanceled200() { + return deleteProvisioning202Deletingcanceled200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteProvisioning202Deletingcanceled200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteProvisioning202Deletingcanceled200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteProvisioning202Deletingcanceled200Async() { + return deleteProvisioning202Deletingcanceled200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteProvisioning202Deletingcanceled200WithServiceResponseAsync() { + Observable> observable = service.deleteProvisioning202Deletingcanceled200(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteProvisioning202Deletingcanceled200HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginDeleteProvisioning202Deletingcanceled200() { + return beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteProvisioning202Deletingcanceled200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginDeleteProvisioning202Deletingcanceled200Async() { + return beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Canceled’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginDeleteProvisioning202Deletingcanceled200WithServiceResponseAsync() { + return service.beginDeleteProvisioning202Deletingcanceled200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteProvisioning202Deletingcanceled200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteProvisioning202Deletingcanceled200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteProvisioning202Deletingcanceled200HeadersInner.class); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete204Succeeded() { + delete204SucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete succeeds and returns right away. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete204SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete204SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete204SucceededAsync() { + return delete204SucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete204SucceededWithServiceResponseAsync() { + Observable> observable = service.delete204Succeeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete204Succeeded() { + beginDelete204SucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete succeeds and returns right away. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete204SucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDelete204SucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDelete204SucceededAsync() { + return beginDelete204SucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running delete succeeds and returns right away. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDelete204SucceededWithServiceResponseAsync() { + return service.beginDelete204Succeeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDelete204SucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDelete204SucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner delete202Retry200() { + return delete202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202Retry200Async() { + return delete202Retry200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202Retry200WithServiceResponseAsync() { + Observable> observable = service.delete202Retry200(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDelete202Retry200HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginDelete202Retry200() { + return beginDelete202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginDelete202Retry200Async() { + return beginDelete202Retry200WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginDelete202Retry200WithServiceResponseAsync() { + return service.beginDelete202Retry200(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDelete202Retry200HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner delete202NoRetry204() { + return delete202NoRetry204WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202NoRetry204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete202NoRetry204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable delete202NoRetry204Async() { + return delete202NoRetry204WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> delete202NoRetry204WithServiceResponseAsync() { + Observable> observable = service.delete202NoRetry204(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDelete202NoRetry204HeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginDelete202NoRetry204() { + return beginDelete202NoRetry204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDelete202NoRetry204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDelete202NoRetry204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginDelete202NoRetry204Async() { + return beginDelete202NoRetry204WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Polls return this value until the last poll returns a ‘200’ with ProvisioningState=’Succeeded’. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginDelete202NoRetry204WithServiceResponseAsync() { + return service.beginDelete202NoRetry204(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDelete202NoRetry204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDelete202NoRetry204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDelete202NoRetry204HeadersInner.class); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteNoHeaderInRetry() { + deleteNoHeaderInRetryWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteNoHeaderInRetryAsync() { + return deleteNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteNoHeaderInRetryWithServiceResponseAsync() { + Observable> observable = service.deleteNoHeaderInRetry(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteNoHeaderInRetryHeadersInner.class); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteNoHeaderInRetry() { + beginDeleteNoHeaderInRetryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteNoHeaderInRetryAsync() { + return beginDeleteNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a location header in the initial request. Subsequent calls to operation status do not contain location header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteNoHeaderInRetryWithServiceResponseAsync() { + return service.beginDeleteNoHeaderInRetry(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteNoHeaderInRetryDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteNoHeaderInRetryHeadersInner.class); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncNoHeaderInRetry() { + deleteAsyncNoHeaderInRetryWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncNoHeaderInRetryAsync() { + return deleteAsyncNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncNoHeaderInRetryWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncNoHeaderInRetry(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncNoHeaderInRetryHeadersInner.class); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncNoHeaderInRetry() { + beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncNoHeaderInRetryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncNoHeaderInRetryAsync() { + return beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns an Azure-AsyncOperation header in the initial request. Subsequent calls to operation status do not contain Azure-AsyncOperation header. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncNoHeaderInRetryWithServiceResponseAsync() { + return service.beginDeleteAsyncNoHeaderInRetry(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncNoHeaderInRetryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncNoHeaderInRetryDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncNoHeaderInRetryHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRetrySucceeded() { + deleteAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRetrySucceededAsync() { + return deleteAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRetrySucceededWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncRetrySucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRetrySucceeded() { + beginDeleteAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRetrySucceededAsync() { + return beginDeleteAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRetrySucceededWithServiceResponseAsync() { + return service.beginDeleteAsyncRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncRetrySucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncNoRetrySucceeded() { + deleteAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncNoRetrySucceededAsync() { + return deleteAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncNoRetrySucceededWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncNoRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncNoRetrySucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncNoRetrySucceeded() { + beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncNoRetrySucceededAsync() { + return beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncNoRetrySucceededWithServiceResponseAsync() { + return service.beginDeleteAsyncNoRetrySucceeded(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncNoRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncNoRetrySucceededHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRetryFailed() { + deleteAsyncRetryFailedWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRetryFailedAsync() { + return deleteAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRetryFailedWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRetryFailed(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncRetryFailedHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRetryFailed() { + beginDeleteAsyncRetryFailedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRetryFailedAsync() { + return beginDeleteAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRetryFailedWithServiceResponseAsync() { + return service.beginDeleteAsyncRetryFailed(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRetryFailedDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncRetryFailedHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void deleteAsyncRetrycanceled() { + deleteAsyncRetrycanceledWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsyncRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(deleteAsyncRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsyncRetrycanceledAsync() { + return deleteAsyncRetrycanceledWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteAsyncRetrycanceledWithServiceResponseAsync() { + Observable> observable = service.deleteAsyncRetrycanceled(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsDeleteAsyncRetrycanceledHeadersInner.class); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDeleteAsyncRetrycanceled() { + beginDeleteAsyncRetrycanceledWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsyncRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginDeleteAsyncRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginDeleteAsyncRetrycanceledAsync() { + return beginDeleteAsyncRetrycanceledWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running delete request, service returns a 202 to the initial request. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginDeleteAsyncRetrycanceledWithServiceResponseAsync() { + return service.beginDeleteAsyncRetrycanceled(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginDeleteAsyncRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginDeleteAsyncRetrycanceledDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsDeleteAsyncRetrycanceledHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner post200WithPayload() { + return post200WithPayloadWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post200WithPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post200WithPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post200WithPayloadAsync() { + return post200WithPayloadWithServiceResponseAsync().map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post200WithPayloadWithServiceResponseAsync() { + Observable> observable = service.post200WithPayload(this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SkuInner object if successful. + */ + public SkuInner beginPost200WithPayload() { + return beginPost200WithPayloadWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost200WithPayloadAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginPost200WithPayloadWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable beginPost200WithPayloadAsync() { + return beginPost200WithPayloadWithServiceResponseAsync().map(new Func1, SkuInner>() { + @Override + public SkuInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header. Poll returns a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SkuInner object + */ + public Observable> beginPost200WithPayloadWithServiceResponseAsync() { + return service.beginPost200WithPayload(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginPost200WithPayloadDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginPost200WithPayloadDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200() { + post202Retry200WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async() { + return post202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPost202Retry200HeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202Retry200(ProductInner product) { + post202Retry200WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Retry200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202Retry200Async(ProductInner product) { + return post202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202Retry200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.post202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPost202Retry200HeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200() { + beginPost202Retry200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async() { + return beginPost202Retry200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPost202Retry200(ProductInner product) { + beginPost202Retry200WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202Retry200Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202Retry200WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPost202Retry200Async(ProductInner product) { + return beginPost202Retry200WithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' and 'Retry-After' headers, Polls return a 200 with a response body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPost202Retry200WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPost202Retry200(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202Retry200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202Retry200Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPost202Retry200HeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner post202NoRetry204() { + return post202NoRetry204WithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NoRetry204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NoRetry204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NoRetry204Async() { + return post202NoRetry204WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NoRetry204WithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.post202NoRetry204(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPost202NoRetry204HeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner post202NoRetry204(ProductInner product) { + return post202NoRetry204WithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202NoRetry204Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post202NoRetry204WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable post202NoRetry204Async(ProductInner product) { + return post202NoRetry204WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> post202NoRetry204WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.post202NoRetry204(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPost202NoRetry204HeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPost202NoRetry204() { + return beginPost202NoRetry204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NoRetry204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NoRetry204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPost202NoRetry204Async() { + return beginPost202NoRetry204WithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPost202NoRetry204WithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPost202NoRetry204(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NoRetry204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPost202NoRetry204(ProductInner product) { + return beginPost202NoRetry204WithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPost202NoRetry204Async(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPost202NoRetry204WithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPost202NoRetry204Async(ProductInner product) { + return beginPost202NoRetry204WithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with 'Location' header, 204 with noresponse body after success. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPost202NoRetry204WithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPost202NoRetry204(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPost202NoRetry204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPost202NoRetry204Delegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPost202NoRetry204HeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner postAsyncRetrySucceeded() { + return postAsyncRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrySucceededAsync() { + return postAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetrySucceededHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner postAsyncRetrySucceeded(ProductInner product) { + return postAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrySucceededAsync(ProductInner product) { + return postAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetrySucceededHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPostAsyncRetrySucceeded() { + return beginPostAsyncRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPostAsyncRetrySucceededAsync() { + return beginPostAsyncRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPostAsyncRetrySucceeded(ProductInner product) { + return beginPostAsyncRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPostAsyncRetrySucceededAsync(ProductInner product) { + return beginPostAsyncRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPostAsyncRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPostAsyncRetrySucceededHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner postAsyncNoRetrySucceeded() { + return postAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncNoRetrySucceededAsync() { + return postAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncNoRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncNoRetrySucceededHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner postAsyncNoRetrySucceeded(ProductInner product) { + return postAsyncNoRetrySucceededWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncNoRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncNoRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncNoRetrySucceededAsync(ProductInner product) { + return postAsyncNoRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncNoRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncNoRetrySucceededHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPostAsyncNoRetrySucceeded() { + return beginPostAsyncNoRetrySucceededWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncNoRetrySucceededAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncNoRetrySucceededWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPostAsyncNoRetrySucceededAsync() { + return beginPostAsyncNoRetrySucceededWithServiceResponseAsync().map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPostAsyncNoRetrySucceededWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ProductInner object if successful. + */ + public ProductInner beginPostAsyncNoRetrySucceeded(ProductInner product) { + return beginPostAsyncNoRetrySucceededWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncNoRetrySucceededAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncNoRetrySucceededWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable beginPostAsyncNoRetrySucceededAsync(ProductInner product) { + return beginPostAsyncNoRetrySucceededWithServiceResponseAsync(product).map(new Func1, ProductInner>() { + @Override + public ProductInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ProductInner object + */ + public Observable> beginPostAsyncNoRetrySucceededWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncNoRetrySucceeded(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncNoRetrySucceededDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncNoRetrySucceededDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPostAsyncNoRetrySucceededHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetryFailed() { + postAsyncRetryFailedWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetryFailedAsync() { + return postAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetryFailedWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetryFailedHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetryFailed(ProductInner product) { + postAsyncRetryFailedWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetryFailedAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetryFailedWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetryFailedAsync(ProductInner product) { + return postAsyncRetryFailedWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetryFailedWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetryFailedHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetryFailed() { + beginPostAsyncRetryFailedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetryFailedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetryFailedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetryFailedAsync() { + return beginPostAsyncRetryFailedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetryFailedWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetryFailed(ProductInner product) { + beginPostAsyncRetryFailedWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetryFailedAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetryFailedWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetryFailedAsync(ProductInner product) { + return beginPostAsyncRetryFailedWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetryFailedWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRetryFailed(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetryFailedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRetryFailedDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPostAsyncRetryFailedHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetrycanceled() { + postAsyncRetrycanceledWithServiceResponseAsync().toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrycanceledAsync() { + return postAsyncRetrycanceledWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrycanceledWithServiceResponseAsync() { + final ProductInner product = null; + Observable> observable = service.postAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetrycanceledHeadersInner.class); + } + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postAsyncRetrycanceled(ProductInner product) { + postAsyncRetrycanceledWithServiceResponseAsync(product).toBlocking().last().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postAsyncRetrycanceledAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(postAsyncRetrycanceledWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable postAsyncRetrycanceledAsync(ProductInner product) { + return postAsyncRetrycanceledWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> postAsyncRetrycanceledWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + Observable> observable = service.postAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultWithHeadersAsync(observable, new TypeToken() { }.getType(), LROsPostAsyncRetrycanceledHeadersInner.class); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetrycanceled() { + beginPostAsyncRetrycanceledWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrycanceledAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrycanceledWithServiceResponseAsync(), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetrycanceledAsync() { + return beginPostAsyncRetrycanceledWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetrycanceledWithServiceResponseAsync() { + final ProductInner product = null; + return service.beginPostAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginPostAsyncRetrycanceled(ProductInner product) { + beginPostAsyncRetrycanceledWithServiceResponseAsync(product).toBlocking().single().body(); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginPostAsyncRetrycanceledAsync(ProductInner product, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(beginPostAsyncRetrycanceledWithServiceResponseAsync(product), serviceCallback); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable beginPostAsyncRetrycanceledAsync(ProductInner product) { + return beginPostAsyncRetrycanceledWithServiceResponseAsync(product).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Long running post request, service returns a 202 to the initial request, with an entity that contains ProvisioningState=’Creating’. Poll the endpoint indicated in the Azure-AsyncOperation header for operation status. + * + * @param product Product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> beginPostAsyncRetrycanceledWithServiceResponseAsync(ProductInner product) { + Validator.validate(product); + return service.beginPostAsyncRetrycanceled(product, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = beginPostAsyncRetrycanceledDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders beginPostAsyncRetrycanceledDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, LROsPostAsyncRetrycanceledHeadersInner.class); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPost202NoRetry204HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPost202NoRetry204HeadersInner.java new file mode 100644 index 0000000000..c439b81f1d --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPost202NoRetry204HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202NoRetry204 operation. + */ +public class LROsPost202NoRetry204HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/post/202/noretry/204. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPost202NoRetry204HeadersInner object itself. + */ + public LROsPost202NoRetry204HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPost202NoRetry204HeadersInner object itself. + */ + public LROsPost202NoRetry204HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPost202Retry200HeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPost202Retry200HeadersInner.java new file mode 100644 index 0000000000..5bfddf1227 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPost202Retry200HeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post202Retry200 operation. + */ +public class LROsPost202Retry200HeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/post/202/retry/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPost202Retry200HeadersInner object itself. + */ + public LROsPost202Retry200HeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPost202Retry200HeadersInner object itself. + */ + public LROsPost202Retry200HeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncNoRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncNoRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..2d86906ec5 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncNoRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncNoRetrySucceeded operation. + */ +public class LROsPostAsyncNoRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPostAsyncNoRetrySucceededHeadersInner object itself. + */ + public LROsPostAsyncNoRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPostAsyncNoRetrySucceededHeadersInner object itself. + */ + public LROsPostAsyncNoRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPostAsyncNoRetrySucceededHeadersInner object itself. + */ + public LROsPostAsyncNoRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetryFailedHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetryFailedHeadersInner.java new file mode 100644 index 0000000000..a756960c7a --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetryFailedHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRetryFailed operation. + */ +public class LROsPostAsyncRetryFailedHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPostAsyncRetryFailedHeadersInner object itself. + */ + public LROsPostAsyncRetryFailedHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPostAsyncRetryFailedHeadersInner object itself. + */ + public LROsPostAsyncRetryFailedHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPostAsyncRetryFailedHeadersInner object itself. + */ + public LROsPostAsyncRetryFailedHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..a4e3747ff1 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRetrySucceeded operation. + */ +public class LROsPostAsyncRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPostAsyncRetrySucceededHeadersInner object itself. + */ + public LROsPostAsyncRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPostAsyncRetrySucceededHeadersInner object itself. + */ + public LROsPostAsyncRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPostAsyncRetrySucceededHeadersInner object itself. + */ + public LROsPostAsyncRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetrycanceledHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetrycanceledHeadersInner.java new file mode 100644 index 0000000000..77b5e30a7b --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPostAsyncRetrycanceledHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for postAsyncRetrycanceled operation. + */ +public class LROsPostAsyncRetrycanceledHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/canceled/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/canceled/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPostAsyncRetrycanceledHeadersInner object itself. + */ + public LROsPostAsyncRetrycanceledHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPostAsyncRetrycanceledHeadersInner object itself. + */ + public LROsPostAsyncRetrycanceledHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPostAsyncRetrycanceledHeadersInner object itself. + */ + public LROsPostAsyncRetrycanceledHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoHeaderInRetryHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoHeaderInRetryHeadersInner.java new file mode 100644 index 0000000000..a00079ae6a --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoHeaderInRetryHeadersInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncNoHeaderInRetry operation. + */ +public class LROsPutAsyncNoHeaderInRetryHeadersInner { + /** + * The azureAsyncOperation property. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncNoHeaderInRetryHeadersInner object itself. + */ + public LROsPutAsyncNoHeaderInRetryHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..b8ae414534 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoRetrySucceededHeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncNoRetrySucceeded operation. + */ +public class LROsPutAsyncNoRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/noretry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/noretry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncNoRetrySucceededHeadersInner object itself. + */ + public LROsPutAsyncNoRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutAsyncNoRetrySucceededHeadersInner object itself. + */ + public LROsPutAsyncNoRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoRetrycanceledHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoRetrycanceledHeadersInner.java new file mode 100644 index 0000000000..11ee2a42fa --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncNoRetrycanceledHeadersInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncNoRetrycanceled operation. + */ +public class LROsPutAsyncNoRetrycanceledHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/noretry/canceled/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/noretry/canceled/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncNoRetrycanceledHeadersInner object itself. + */ + public LROsPutAsyncNoRetrycanceledHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutAsyncNoRetrycanceledHeadersInner object itself. + */ + public LROsPutAsyncNoRetrycanceledHeadersInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncRetryFailedHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncRetryFailedHeadersInner.java new file mode 100644 index 0000000000..b7a473bd42 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncRetryFailedHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRetryFailed operation. + */ +public class LROsPutAsyncRetryFailedHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/failed/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncRetryFailedHeadersInner object itself. + */ + public LROsPutAsyncRetryFailedHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutAsyncRetryFailedHeadersInner object itself. + */ + public LROsPutAsyncRetryFailedHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPutAsyncRetryFailedHeadersInner object itself. + */ + public LROsPutAsyncRetryFailedHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncRetrySucceededHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncRetrySucceededHeadersInner.java new file mode 100644 index 0000000000..c08896e6aa --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutAsyncRetrySucceededHeadersInner.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putAsyncRetrySucceeded operation. + */ +public class LROsPutAsyncRetrySucceededHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Azure-AsyncOperation") + private String azureAsyncOperation; + + /** + * Location to poll for result status: will be set to + * /lro/putasync/retry/succeeded/operationResults/200. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Number of milliseconds until the next poll should be sent, will be set + * to zero. + */ + @JsonProperty(value = "Retry-After") + private Integer retryAfter; + + /** + * Get the azureAsyncOperation value. + * + * @return the azureAsyncOperation value + */ + public String azureAsyncOperation() { + return this.azureAsyncOperation; + } + + /** + * Set the azureAsyncOperation value. + * + * @param azureAsyncOperation the azureAsyncOperation value to set + * @return the LROsPutAsyncRetrySucceededHeadersInner object itself. + */ + public LROsPutAsyncRetrySucceededHeadersInner withAzureAsyncOperation(String azureAsyncOperation) { + this.azureAsyncOperation = azureAsyncOperation; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutAsyncRetrySucceededHeadersInner object itself. + */ + public LROsPutAsyncRetrySucceededHeadersInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the retryAfter value. + * + * @return the retryAfter value + */ + public Integer retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter value. + * + * @param retryAfter the retryAfter value to set + * @return the LROsPutAsyncRetrySucceededHeadersInner object itself. + */ + public LROsPutAsyncRetrySucceededHeadersInner withRetryAfter(Integer retryAfter) { + this.retryAfter = retryAfter; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutNoHeaderInRetryHeadersInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutNoHeaderInRetryHeadersInner.java new file mode 100644 index 0000000000..0e40f8b064 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/LROsPutNoHeaderInRetryHeadersInner.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for putNoHeaderInRetry operation. + */ +public class LROsPutNoHeaderInRetryHeadersInner { + /** + * Location to poll for result status: will be set to + * /lro/putasync/noheader/202/200/operationResults. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the LROsPutNoHeaderInRetryHeadersInner object itself. + */ + public LROsPutNoHeaderInRetryHeadersInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/ProductInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/ProductInner.java new file mode 100644 index 0000000000..f529bbd6ec --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/ProductInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The ProductInner model. + */ +@JsonFlatten +public class ProductInner extends Resource { + /** + * The provisioningState property. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Possible values include: 'Succeeded', 'Failed', 'canceled', 'Accepted', + * 'Creating', 'Created', 'Updating', 'Updated', 'Deleting', 'Deleted', + * 'OK'. + */ + @JsonProperty(value = "properties.provisioningStateValues", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStateValues; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the ProductInner object itself. + */ + public ProductInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the provisioningStateValues value. + * + * @return the provisioningStateValues value + */ + public String provisioningStateValues() { + return this.provisioningStateValues; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/SkuInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/SkuInner.java new file mode 100644 index 0000000000..ff9101c864 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/SkuInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SkuInner model. + */ +public class SkuInner { + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The id property. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the SkuInner object itself. + */ + public SkuInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the SkuInner object itself. + */ + public SkuInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/SubProductInner.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/SubProductInner.java new file mode 100644 index 0000000000..aa6a1bab03 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/SubProductInner.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.lro.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.SubResource; + +/** + * The SubProductInner model. + */ +@JsonFlatten +public class SubProductInner extends SubResource { + /** + * The provisioningState property. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Possible values include: 'Succeeded', 'Failed', 'canceled', 'Accepted', + * 'Creating', 'Created', 'Updating', 'Updated', 'Deleting', 'Deleted', + * 'OK'. + */ + @JsonProperty(value = "properties.provisioningStateValues", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStateValues; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the SubProductInner object itself. + */ + public SubProductInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the provisioningStateValues value. + * + * @return the provisioningStateValues value + */ + public String provisioningStateValues() { + return this.provisioningStateValues; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/lro/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/lro/implementation/package-info.java new file mode 100644 index 0000000000..8f0b083f87 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestLongRunningOperationTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.lro.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/lro/package-info.java b/test/azurefluent/src/main/java/fixtures/lro/package-info.java new file mode 100644 index 0000000000..4d8c8286a0 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/lro/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestLongRunningOperationTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.lro; diff --git a/test/azurefluent/src/main/java/fixtures/paging/OperationResult.java b/test/azurefluent/src/main/java/fixtures/paging/OperationResult.java new file mode 100644 index 0000000000..219fd8ae12 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/OperationResult.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationResult model. + */ +public class OperationResult { + /** + * The status of the request. Possible values include: 'Succeeded', + * 'Failed', 'canceled', 'Accepted', 'Creating', 'Created', 'Updating', + * 'Updated', 'Deleting', 'Deleted', 'OK'. + */ + @JsonProperty(value = "status") + private String status; + + /** + * Get the status value. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the OperationResult object itself. + */ + public OperationResult withStatus(String status) { + this.status = status; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/ProductProperties.java b/test/azurefluent/src/main/java/fixtures/paging/ProductProperties.java new file mode 100644 index 0000000000..c6c682e8bf --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/ProductProperties.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ProductProperties model. + */ +public class ProductProperties { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the ProductProperties object itself. + */ + public ProductProperties withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the ProductProperties object itself. + */ + public ProductProperties withName(String name) { + this.name = name; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/AutoRestPagingTestServiceImpl.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/AutoRestPagingTestServiceImpl.java new file mode 100644 index 0000000000..c9b039a67e --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/AutoRestPagingTestServiceImpl.java @@ -0,0 +1,162 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the AutoRestPagingTestServiceImpl class. + */ +public class AutoRestPagingTestServiceImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public AutoRestPagingTestServiceImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public AutoRestPagingTestServiceImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public AutoRestPagingTestServiceImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The PagingsInner object to access its operations. + */ + private PagingsInner pagings; + + /** + * Gets the PagingsInner object to access its operations. + * @return the PagingsInner object. + */ + public PagingsInner pagings() { + return this.pagings; + } + + /** + * Initializes an instance of AutoRestPagingTestService client. + * + * @param credentials the management credentials for Azure + */ + public AutoRestPagingTestServiceImpl(ServiceClientCredentials credentials) { + this("http://localhost", credentials); + } + + /** + * Initializes an instance of AutoRestPagingTestService client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public AutoRestPagingTestServiceImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of AutoRestPagingTestService client. + * + * @param restClient the REST client to connect to Azure. + */ + public AutoRestPagingTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.pagings = new PagingsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "AutoRestPagingTestService", "1.0.0"); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/CustomParameterGroupInner.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/CustomParameterGroupInner.java new file mode 100644 index 0000000000..a413c21f6e --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/CustomParameterGroupInner.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for a set of operations, such as: + * Paging_getMultiplePagesFragmentWithGroupingNextLink, + * Paging_nextFragmentWithGrouping. + */ +public class CustomParameterGroupInner { + /** + * Sets the api version to use. + */ + @JsonProperty(value = "", required = true) + private String apiVersion; + + /** + * Sets the tenant to use. + */ + @JsonProperty(value = "", required = true) + private String tenant; + + /** + * Get the apiVersion value. + * + * @return the apiVersion value + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Set the apiVersion value. + * + * @param apiVersion the apiVersion value to set + * @return the CustomParameterGroupInner object itself. + */ + public CustomParameterGroupInner withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Get the tenant value. + * + * @return the tenant value + */ + public String tenant() { + return this.tenant; + } + + /** + * Set the tenant value. + * + * @param tenant the tenant value to set + * @return the CustomParameterGroupInner object itself. + */ + public CustomParameterGroupInner withTenant(String tenant) { + this.tenant = tenant; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/PageImpl.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/PageImpl.java new file mode 100644 index 0000000000..59614664b2 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/PageImpl.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("values") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/PageImpl1.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/PageImpl1.java new file mode 100644 index 0000000000..81acc940b1 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/PageImpl1.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("odata.nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("values") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl1 setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesOptionsInner.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesOptionsInner.java new file mode 100644 index 0000000000..4462bf7162 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesOptionsInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for getMultiplePages operation. + */ +public class PagingGetMultiplePagesOptionsInner { + /** + * Sets the maximum number of items to return in the response. + */ + @JsonProperty(value = "") + private Integer maxresults; + + /** + * Sets the maximum time that the server can spend processing the request, + * in seconds. The default is 30 seconds. + */ + @JsonProperty(value = "") + private Integer timeout; + + /** + * Get the maxresults value. + * + * @return the maxresults value + */ + public Integer maxresults() { + return this.maxresults; + } + + /** + * Set the maxresults value. + * + * @param maxresults the maxresults value to set + * @return the PagingGetMultiplePagesOptionsInner object itself. + */ + public PagingGetMultiplePagesOptionsInner withMaxresults(Integer maxresults) { + this.maxresults = maxresults; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the PagingGetMultiplePagesOptionsInner object itself. + */ + public PagingGetMultiplePagesOptionsInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesWithOffsetNextOptionsInner.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesWithOffsetNextOptionsInner.java new file mode 100644 index 0000000000..2367ddb644 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesWithOffsetNextOptionsInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for getMultiplePagesWithOffsetNext operation. + */ +public class PagingGetMultiplePagesWithOffsetNextOptionsInner { + /** + * Sets the maximum number of items to return in the response. + */ + @JsonProperty(value = "") + private Integer maxresults; + + /** + * Sets the maximum time that the server can spend processing the request, + * in seconds. The default is 30 seconds. + */ + @JsonProperty(value = "") + private Integer timeout; + + /** + * Get the maxresults value. + * + * @return the maxresults value + */ + public Integer maxresults() { + return this.maxresults; + } + + /** + * Set the maxresults value. + * + * @param maxresults the maxresults value to set + * @return the PagingGetMultiplePagesWithOffsetNextOptionsInner object itself. + */ + public PagingGetMultiplePagesWithOffsetNextOptionsInner withMaxresults(Integer maxresults) { + this.maxresults = maxresults; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the PagingGetMultiplePagesWithOffsetNextOptionsInner object itself. + */ + public PagingGetMultiplePagesWithOffsetNextOptionsInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesWithOffsetOptionsInner.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesWithOffsetOptionsInner.java new file mode 100644 index 0000000000..c258887138 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetMultiplePagesWithOffsetOptionsInner.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for getMultiplePagesWithOffset operation. + */ +public class PagingGetMultiplePagesWithOffsetOptionsInner { + /** + * Sets the maximum number of items to return in the response. + */ + @JsonProperty(value = "") + private Integer maxresults; + + /** + * Offset of return value. + */ + @JsonProperty(value = "", required = true) + private int offset; + + /** + * Sets the maximum time that the server can spend processing the request, + * in seconds. The default is 30 seconds. + */ + @JsonProperty(value = "") + private Integer timeout; + + /** + * Get the maxresults value. + * + * @return the maxresults value + */ + public Integer maxresults() { + return this.maxresults; + } + + /** + * Set the maxresults value. + * + * @param maxresults the maxresults value to set + * @return the PagingGetMultiplePagesWithOffsetOptionsInner object itself. + */ + public PagingGetMultiplePagesWithOffsetOptionsInner withMaxresults(Integer maxresults) { + this.maxresults = maxresults; + return this; + } + + /** + * Get the offset value. + * + * @return the offset value + */ + public int offset() { + return this.offset; + } + + /** + * Set the offset value. + * + * @param offset the offset value to set + * @return the PagingGetMultiplePagesWithOffsetOptionsInner object itself. + */ + public PagingGetMultiplePagesWithOffsetOptionsInner withOffset(int offset) { + this.offset = offset; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the PagingGetMultiplePagesWithOffsetOptionsInner object itself. + */ + public PagingGetMultiplePagesWithOffsetOptionsInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetOdataMultiplePagesOptionsInner.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetOdataMultiplePagesOptionsInner.java new file mode 100644 index 0000000000..7a6b4e9af0 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingGetOdataMultiplePagesOptionsInner.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Additional parameters for getOdataMultiplePages operation. + */ +public class PagingGetOdataMultiplePagesOptionsInner { + /** + * Sets the maximum number of items to return in the response. + */ + @JsonProperty(value = "") + private Integer maxresults; + + /** + * Sets the maximum time that the server can spend processing the request, + * in seconds. The default is 30 seconds. + */ + @JsonProperty(value = "") + private Integer timeout; + + /** + * Get the maxresults value. + * + * @return the maxresults value + */ + public Integer maxresults() { + return this.maxresults; + } + + /** + * Set the maxresults value. + * + * @param maxresults the maxresults value to set + * @return the PagingGetOdataMultiplePagesOptionsInner object itself. + */ + public PagingGetOdataMultiplePagesOptionsInner withMaxresults(Integer maxresults) { + this.maxresults = maxresults; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the PagingGetOdataMultiplePagesOptionsInner object itself. + */ + public PagingGetOdataMultiplePagesOptionsInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingsInner.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingsInner.java new file mode 100644 index 0000000000..1c141f4dfa --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/PagingsInner.java @@ -0,0 +1,3295 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Pagings. + */ +public class PagingsInner { + /** The Retrofit service to perform REST calls. */ + private PagingsService service; + /** The service client containing this operation class. */ + private AutoRestPagingTestServiceImpl client; + + /** + * Initializes an instance of PagingsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PagingsInner(Retrofit retrofit, AutoRestPagingTestServiceImpl client) { + this.service = retrofit.create(PagingsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Pagings to be + * used by Retrofit to perform actually REST calls. + */ + interface PagingsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePages" }) + @GET("paging/single") + Observable> getSinglePages(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePages" }) + @GET("paging/multiple") + Observable> getMultiplePages(@Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getOdataMultiplePages" }) + @GET("paging/multiple/odata") + Observable> getOdataMultiplePages(@Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesWithOffset" }) + @GET("paging/multiple/withpath/{offset}") + Observable> getMultiplePagesWithOffset(@Path("offset") int offset, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetryFirst" }) + @GET("paging/multiple/retryfirst") + Observable> getMultiplePagesRetryFirst(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetrySecond" }) + @GET("paging/multiple/retrysecond") + Observable> getMultiplePagesRetrySecond(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesFailure" }) + @GET("paging/single/failure") + Observable> getSinglePagesFailure(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailure" }) + @GET("paging/multiple/failure") + Observable> getMultiplePagesFailure(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureUri" }) + @GET("paging/multiple/failureuri") + Observable> getMultiplePagesFailureUri(@Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFragmentNextLink" }) + @GET("paging/multiple/fragment/{tenant}") + Observable> getMultiplePagesFragmentNextLink(@Path("tenant") String tenant, @Query("api_version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFragmentWithGroupingNextLink" }) + @GET("paging/multiple/fragmentwithgrouping/{tenant}") + Observable> getMultiplePagesFragmentWithGroupingNextLink(@Path("tenant") String tenant, @Header("accept-language") String acceptLanguage, @Query("api_version") String apiVersion, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings nextFragment" }) + @GET + Observable> nextFragment(@Url String nextUrl, @Query("api_version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings nextFragmentWithGrouping" }) + @GET + Observable> nextFragmentWithGrouping(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Query("api_version") String apiVersion, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesNext" }) + @GET + Observable> getSinglePagesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesNext" }) + @GET + Observable> getMultiplePagesNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getOdataMultiplePagesNext" }) + @GET + Observable> getOdataMultiplePagesNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesWithOffsetNext" }) + @GET + Observable> getMultiplePagesWithOffsetNext(@Url String nextUrl, @Header("client-request-id") String clientRequestId, @Header("accept-language") String acceptLanguage, @Header("maxresults") Integer maxresults, @Header("timeout") Integer timeout, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetryFirstNext" }) + @GET + Observable> getMultiplePagesRetryFirstNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesRetrySecondNext" }) + @GET + Observable> getMultiplePagesRetrySecondNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getSinglePagesFailureNext" }) + @GET + Observable> getSinglePagesFailureNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureNext" }) + @GET + Observable> getMultiplePagesFailureNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.paging.Pagings getMultiplePagesFailureUriNext" }) + @GET + Observable> getMultiplePagesFailureUriNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getSinglePages() { + ServiceResponse> response = getSinglePagesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSinglePagesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePagesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getSinglePagesAsync() { + return getSinglePagesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getSinglePagesWithServiceResponseAsync() { + return getSinglePagesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSinglePagesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePagesSinglePageAsync() { + return service.getSinglePages(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSinglePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSinglePagesDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePages() { + ServiceResponse> response = getMultiplePagesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesAsync() { + return getMultiplePagesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesWithServiceResponseAsync() { + return getMultiplePagesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesSinglePageAsync() { + final String clientRequestId = null; + final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions = null; + Integer maxresults = null; + Integer timeout = null; + return service.getMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePages(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) { + ServiceResponse> response = getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesAsync(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesAsync(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) { + return getMultiplePagesWithServiceResponseAsync(clientRequestId, pagingGetMultiplePagesOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesWithServiceResponseAsync(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) { + return getMultiplePagesSinglePageAsync(clientRequestId, pagingGetMultiplePagesOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesSinglePageAsync(final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) { + Validator.validate(pagingGetMultiplePagesOptions); + Integer maxresults = null; + if (pagingGetMultiplePagesOptions != null) { + maxresults = pagingGetMultiplePagesOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetMultiplePagesOptions != null) { + timeout = pagingGetMultiplePagesOptions.timeout(); + } + return service.getMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getOdataMultiplePages() { + ServiceResponse> response = getOdataMultiplePagesSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getOdataMultiplePagesAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOdataMultiplePagesSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getOdataMultiplePagesAsync() { + return getOdataMultiplePagesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getOdataMultiplePagesWithServiceResponseAsync() { + return getOdataMultiplePagesSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOdataMultiplePagesSinglePageAsync() { + final String clientRequestId = null; + final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions = null; + Integer maxresults = null; + Integer timeout = null; + return service.getOdataMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOdataMultiplePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getOdataMultiplePages(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) { + ServiceResponse> response = getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getOdataMultiplePagesAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) { + return getOdataMultiplePagesWithServiceResponseAsync(clientRequestId, pagingGetOdataMultiplePagesOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getOdataMultiplePagesWithServiceResponseAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) { + return getOdataMultiplePagesSinglePageAsync(clientRequestId, pagingGetOdataMultiplePagesOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOdataMultiplePagesSinglePageAsync(final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) { + Validator.validate(pagingGetOdataMultiplePagesOptions); + Integer maxresults = null; + if (pagingGetOdataMultiplePagesOptions != null) { + maxresults = pagingGetOdataMultiplePagesOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetOdataMultiplePagesOptions != null) { + timeout = pagingGetOdataMultiplePagesOptions.timeout(); + } + return service.getOdataMultiplePages(clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOdataMultiplePagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getOdataMultiplePagesDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions) { + ServiceResponse> response = getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions) { + return getMultiplePagesWithOffsetWithServiceResponseAsync(pagingGetMultiplePagesWithOffsetOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesWithOffsetWithServiceResponseAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions) { + return getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, null, pagingGetMultiplePagesWithOffsetNextOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesWithOffsetSinglePageAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions) { + if (pagingGetMultiplePagesWithOffsetOptions == null) { + throw new IllegalArgumentException("Parameter pagingGetMultiplePagesWithOffsetOptions is required and cannot be null."); + } + Validator.validate(pagingGetMultiplePagesWithOffsetOptions); + final String clientRequestId = null; + Integer maxresults = pagingGetMultiplePagesWithOffsetOptions.maxresults(); + int offset = pagingGetMultiplePagesWithOffsetOptions.offset(); + Integer timeout = pagingGetMultiplePagesWithOffsetOptions.timeout(); + return service.getMultiplePagesWithOffset(offset, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesWithOffsetDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesWithOffset(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) { + ServiceResponse> response = getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesWithOffsetAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) { + return getMultiplePagesWithOffsetWithServiceResponseAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesWithOffsetWithServiceResponseAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) { + return getMultiplePagesWithOffsetSinglePageAsync(pagingGetMultiplePagesWithOffsetOptions, clientRequestId) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = new PagingGetMultiplePagesWithOffsetNextOptionsInner(); + pagingGetMultiplePagesWithOffsetNextOptions.withMaxresults(pagingGetMultiplePagesWithOffsetOptions.maxresults()); + pagingGetMultiplePagesWithOffsetNextOptions.withTimeout(pagingGetMultiplePagesWithOffsetOptions.timeout()); + return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + ServiceResponse> * @param pagingGetMultiplePagesWithOffsetOptions Additional parameters for the operation + ServiceResponse> * @param clientRequestId the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesWithOffsetSinglePageAsync(final PagingGetMultiplePagesWithOffsetOptionsInner pagingGetMultiplePagesWithOffsetOptions, final String clientRequestId) { + if (pagingGetMultiplePagesWithOffsetOptions == null) { + throw new IllegalArgumentException("Parameter pagingGetMultiplePagesWithOffsetOptions is required and cannot be null."); + } + Validator.validate(pagingGetMultiplePagesWithOffsetOptions); + Integer maxresults = pagingGetMultiplePagesWithOffsetOptions.maxresults(); + int offset = pagingGetMultiplePagesWithOffsetOptions.offset(); + Integer timeout = pagingGetMultiplePagesWithOffsetOptions.timeout(); + return service.getMultiplePagesWithOffset(offset, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesWithOffsetDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesWithOffsetDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesRetryFirst() { + ServiceResponse> response = getMultiplePagesRetryFirstSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesRetryFirstAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesRetryFirstSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesRetryFirstAsync() { + return getMultiplePagesRetryFirstWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesRetryFirstWithServiceResponseAsync() { + return getMultiplePagesRetryFirstSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesRetryFirstSinglePageAsync() { + return service.getMultiplePagesRetryFirst(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesRetryFirstDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesRetryFirstDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesRetrySecond() { + ServiceResponse> response = getMultiplePagesRetrySecondSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesRetrySecondAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesRetrySecondSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesRetrySecondAsync() { + return getMultiplePagesRetrySecondWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesRetrySecondWithServiceResponseAsync() { + return getMultiplePagesRetrySecondSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesRetrySecondSinglePageAsync() { + return service.getMultiplePagesRetrySecond(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesRetrySecondDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesRetrySecondDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getSinglePagesFailure() { + ServiceResponse> response = getSinglePagesFailureSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSinglePagesFailureAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePagesFailureSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getSinglePagesFailureAsync() { + return getSinglePagesFailureWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getSinglePagesFailureWithServiceResponseAsync() { + return getSinglePagesFailureSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePagesFailureSinglePageAsync() { + return service.getSinglePagesFailure(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSinglePagesFailureDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSinglePagesFailureDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesFailure() { + ServiceResponse> response = getMultiplePagesFailureSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFailureAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFailureSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesFailureAsync() { + return getMultiplePagesFailureWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesFailureWithServiceResponseAsync() { + return getMultiplePagesFailureSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFailureSinglePageAsync() { + return service.getMultiplePagesFailure(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFailureDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFailureDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesFailureUri() { + ServiceResponse> response = getMultiplePagesFailureUriSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFailureUriAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFailureUriSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesFailureUriAsync() { + return getMultiplePagesFailureUriWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesFailureUriWithServiceResponseAsync() { + return getMultiplePagesFailureUriSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFailureUriSinglePageAsync() { + return service.getMultiplePagesFailureUri(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFailureUriDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFailureUriDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesFragmentNextLink(final String tenant, final String apiVersion) { + ServiceResponse> response = getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextLink) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFragmentNextLinkAsync(final String tenant, final String apiVersion, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion), + new Func1>>>() { + @Override + public Observable>> call(String nextLink) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion); + } + }, + serviceCallback); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesFragmentNextLinkAsync(final String tenant, final String apiVersion) { + return getMultiplePagesFragmentNextLinkWithServiceResponseAsync(tenant, apiVersion) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesFragmentNextLinkWithServiceResponseAsync(final String tenant, final String apiVersion) { + return getMultiplePagesFragmentNextLinkSinglePageAsync(tenant, apiVersion) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextLink = page.body().nextPageLink(); + if (nextLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion)); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + ServiceResponse> * @param tenant Sets the tenant to use. + ServiceResponse> * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFragmentNextLinkSinglePageAsync(final String tenant, final String apiVersion) { + if (tenant == null) { + throw new IllegalArgumentException("Parameter tenant is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + return service.getMultiplePagesFragmentNextLink(tenant, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFragmentNextLinkDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFragmentNextLinkDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesFragmentWithGroupingNextLink(final CustomParameterGroupInner customParameterGroup) { + ServiceResponse> response = getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextLink) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFragmentWithGroupingNextLinkAsync(final CustomParameterGroupInner customParameterGroup, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup), + new Func1>>>() { + @Override + public Observable>> call(String nextLink) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup); + } + }, + serviceCallback); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesFragmentWithGroupingNextLinkAsync(final CustomParameterGroupInner customParameterGroup) { + return getMultiplePagesFragmentWithGroupingNextLinkWithServiceResponseAsync(customParameterGroup) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesFragmentWithGroupingNextLinkWithServiceResponseAsync(final CustomParameterGroupInner customParameterGroup) { + return getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(customParameterGroup) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextLink = page.body().nextPageLink(); + if (nextLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup)); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment with parameters grouped. + * + ServiceResponse> * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFragmentWithGroupingNextLinkSinglePageAsync(final CustomParameterGroupInner customParameterGroup) { + if (customParameterGroup == null) { + throw new IllegalArgumentException("Parameter customParameterGroup is required and cannot be null."); + } + Validator.validate(customParameterGroup); + String apiVersion = customParameterGroup.apiVersion(); + String tenant = customParameterGroup.tenant(); + return service.getMultiplePagesFragmentWithGroupingNextLink(tenant, this.client.acceptLanguage(), apiVersion, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFragmentWithGroupingNextLinkDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFragmentWithGroupingNextLinkDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList nextFragment(final String tenant, final String nextLink, final String apiVersion) { + ServiceResponse> response = nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextLink) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> nextFragmentAsync(final String tenant, final String nextLink, final String apiVersion, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + nextFragmentSinglePageAsync(tenant, nextLink, apiVersion), + new Func1>>>() { + @Override + public Observable>> call(String nextLink) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion); + } + }, + serviceCallback); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> nextFragmentAsync(final String tenant, final String nextLink, final String apiVersion) { + return nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param tenant Sets the tenant to use. + * @param nextLink Next link for list operation. + * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> nextFragmentWithServiceResponseAsync(final String tenant, final String nextLink, final String apiVersion) { + return nextFragmentSinglePageAsync(tenant, nextLink, apiVersion) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextLink = page.body().nextPageLink(); + if (nextLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(nextFragmentWithServiceResponseAsync(tenant, nextLink, apiVersion)); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + ServiceResponse> * @param tenant Sets the tenant to use. + ServiceResponse> * @param nextLink Next link for list operation. + ServiceResponse> * @param apiVersion Sets the api version to use. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> nextFragmentSinglePageAsync(final String tenant, final String nextLink, final String apiVersion) { + if (tenant == null) { + throw new IllegalArgumentException("Parameter tenant is required and cannot be null."); + } + if (nextLink == null) { + throw new IllegalArgumentException("Parameter nextLink is required and cannot be null."); + } + if (apiVersion == null) { + throw new IllegalArgumentException("Parameter apiVersion is required and cannot be null."); + } + String nextUrl = String.format("paging/multiple/fragment/%s/%s", tenant, nextLink); + return service.nextFragment(nextUrl, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = nextFragmentDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> nextFragmentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList nextFragmentWithGrouping(final String nextLink, final CustomParameterGroupInner customParameterGroup) { + ServiceResponse> response = nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextLink) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> nextFragmentWithGroupingAsync(final String nextLink, final CustomParameterGroupInner customParameterGroup, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup), + new Func1>>>() { + @Override + public Observable>> call(String nextLink) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup); + } + }, + serviceCallback); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> nextFragmentWithGroupingAsync(final String nextLink, final CustomParameterGroupInner customParameterGroup) { + return nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + * @param nextLink Next link for list operation. + * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> nextFragmentWithGroupingWithServiceResponseAsync(final String nextLink, final CustomParameterGroupInner customParameterGroup) { + return nextFragmentWithGroupingSinglePageAsync(nextLink, customParameterGroup) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextLink = page.body().nextPageLink(); + if (nextLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(nextFragmentWithGroupingWithServiceResponseAsync(nextLink, customParameterGroup)); + } + }); + } + + /** + * A paging operation that doesn't return a full URL, just a fragment. + * + ServiceResponse> * @param nextLink Next link for list operation. + ServiceResponse> * @param customParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> nextFragmentWithGroupingSinglePageAsync(final String nextLink, final CustomParameterGroupInner customParameterGroup) { + if (nextLink == null) { + throw new IllegalArgumentException("Parameter nextLink is required and cannot be null."); + } + if (customParameterGroup == null) { + throw new IllegalArgumentException("Parameter customParameterGroup is required and cannot be null."); + } + Validator.validate(customParameterGroup); + String apiVersion = customParameterGroup.apiVersion(); + String tenant = customParameterGroup.tenant(); + String nextUrl = String.format("paging/multiple/fragmentwithgrouping/%s/%s", tenant, nextLink); + return service.nextFragmentWithGrouping(nextUrl, this.client.acceptLanguage(), apiVersion, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = nextFragmentWithGroupingDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> nextFragmentWithGroupingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getSinglePagesNext(final String nextPageLink) { + ServiceResponse> response = getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSinglePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePagesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getSinglePagesNextAsync(final String nextPageLink) { + return getSinglePagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getSinglePagesNextWithServiceResponseAsync(final String nextPageLink) { + return getSinglePagesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSinglePagesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that finishes on the first call without a nextlink. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePagesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSinglePagesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSinglePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSinglePagesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesNextAsync(final String nextPageLink) { + return getMultiplePagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final String clientRequestId = null; + final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions = null; + Integer maxresults = null; + Integer timeout = null; + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesNext(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) { + ServiceResponse> response = getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) { + return getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) { + return getMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesOptionsInner pagingGetMultiplePagesOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(pagingGetMultiplePagesOptions); + Integer maxresults = null; + if (pagingGetMultiplePagesOptions != null) { + maxresults = pagingGetMultiplePagesOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetMultiplePagesOptions != null) { + timeout = pagingGetMultiplePagesOptions.timeout(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getOdataMultiplePagesNext(final String nextPageLink) { + ServiceResponse> response = getOdataMultiplePagesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getOdataMultiplePagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOdataMultiplePagesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getOdataMultiplePagesNextAsync(final String nextPageLink) { + return getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getOdataMultiplePagesNextWithServiceResponseAsync(final String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOdataMultiplePagesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final String clientRequestId = null; + final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions = null; + Integer maxresults = null; + Integer timeout = null; + String nextUrl = String.format("%s", nextPageLink); + return service.getOdataMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOdataMultiplePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getOdataMultiplePagesNext(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) { + ServiceResponse> response = getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getOdataMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getOdataMultiplePagesNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) { + return getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getOdataMultiplePagesNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) { + return getOdataMultiplePagesNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getOdataMultiplePagesNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetOdataMultiplePagesOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink in odata format that has 10 pages. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetOdataMultiplePagesOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getOdataMultiplePagesNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetOdataMultiplePagesOptionsInner pagingGetOdataMultiplePagesOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(pagingGetOdataMultiplePagesOptions); + Integer maxresults = null; + if (pagingGetOdataMultiplePagesOptions != null) { + maxresults = pagingGetOdataMultiplePagesOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetOdataMultiplePagesOptions != null) { + timeout = pagingGetOdataMultiplePagesOptions.timeout(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getOdataMultiplePagesNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getOdataMultiplePagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getOdataMultiplePagesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesWithOffsetNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, null).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, null, null); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesWithOffsetNextAsync(final String nextPageLink) { + return getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesWithOffsetNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, null, null)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesWithOffsetNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + final String clientRequestId = null; + final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions = null; + Integer maxresults = null; + Integer timeout = null; + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesWithOffsetNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesWithOffsetNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesWithOffsetNext(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions) { + ServiceResponse> response = getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesWithOffsetNextAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions) { + return getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param clientRequestId the String value + * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesWithOffsetNextWithServiceResponseAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions) { + return getMultiplePagesWithOffsetNextSinglePageAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesWithOffsetNextWithServiceResponseAsync(nextPageLink, clientRequestId, pagingGetMultiplePagesWithOffsetNextOptions)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param clientRequestId the String value + ServiceResponse> * @param pagingGetMultiplePagesWithOffsetNextOptions Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesWithOffsetNextSinglePageAsync(final String nextPageLink, final String clientRequestId, final PagingGetMultiplePagesWithOffsetNextOptionsInner pagingGetMultiplePagesWithOffsetNextOptions) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + Validator.validate(pagingGetMultiplePagesWithOffsetNextOptions); + Integer maxresults = null; + if (pagingGetMultiplePagesWithOffsetNextOptions != null) { + maxresults = pagingGetMultiplePagesWithOffsetNextOptions.maxresults(); + } + Integer timeout = null; + if (pagingGetMultiplePagesWithOffsetNextOptions != null) { + timeout = pagingGetMultiplePagesWithOffsetNextOptions.timeout(); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesWithOffsetNext(nextUrl, clientRequestId, this.client.acceptLanguage(), maxresults, timeout, this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesWithOffsetNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesWithOffsetNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesRetryFirstNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesRetryFirstNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesRetryFirstNextAsync(final String nextPageLink) { + return getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesRetryFirstNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesRetryFirstNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesRetryFirstNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that fails on the first call with 500 and then retries and then get a response including a nextLink that has 10 pages. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesRetryFirstNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesRetryFirstNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesRetryFirstNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesRetryFirstNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesRetrySecondNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesRetrySecondNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesRetrySecondNextAsync(final String nextPageLink) { + return getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesRetrySecondNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesRetrySecondNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesRetrySecondNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that includes a nextLink that has 10 pages, of which the 2nd call fails first with 500. The client should retry and finish all 10 pages eventually. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesRetrySecondNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesRetrySecondNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesRetrySecondNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesRetrySecondNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getSinglePagesFailureNext(final String nextPageLink) { + ServiceResponse> response = getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getSinglePagesFailureNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getSinglePagesFailureNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getSinglePagesFailureNextAsync(final String nextPageLink) { + return getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives a 400 on the first call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getSinglePagesFailureNextWithServiceResponseAsync(final String nextPageLink) { + return getSinglePagesFailureNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSinglePagesFailureNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives a 400 on the first call. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getSinglePagesFailureNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getSinglePagesFailureNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getSinglePagesFailureNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getSinglePagesFailureNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesFailureNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFailureNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFailureNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesFailureNextAsync(final String nextPageLink) { + return getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives a 400 on the second call. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesFailureNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesFailureNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesFailureNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives a 400 on the second call. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFailureNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesFailureNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFailureNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFailureNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ProductInner> object if successful. + */ + public PagedList getMultiplePagesFailureUriNext(final String nextPageLink) { + ServiceResponse> response = getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getMultiplePagesFailureUriNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable> getMultiplePagesFailureUriNextAsync(final String nextPageLink) { + return getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * A paging operation that receives an invalid nextLink. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ProductInner> object + */ + public Observable>> getMultiplePagesFailureUriNextWithServiceResponseAsync(final String nextPageLink) { + return getMultiplePagesFailureUriNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiplePagesFailureUriNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * A paging operation that receives an invalid nextLink. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ProductInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> getMultiplePagesFailureUriNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.getMultiplePagesFailureUriNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getMultiplePagesFailureUriNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getMultiplePagesFailureUriNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/ProductInner.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/ProductInner.java new file mode 100644 index 0000000000..20db09bcb1 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/ProductInner.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.paging.implementation; + +import fixtures.paging.ProductProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ProductInner model. + */ +public class ProductInner { + /** + * The properties property. + */ + @JsonProperty(value = "properties") + private ProductProperties properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public ProductProperties properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the ProductInner object itself. + */ + public ProductInner withProperties(ProductProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/paging/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/paging/implementation/package-info.java new file mode 100644 index 0000000000..2a185d9735 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestPagingTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.paging.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/paging/package-info.java b/test/azurefluent/src/main/java/fixtures/paging/package-info.java new file mode 100644 index 0000000000..97f3ff652a --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/paging/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestPagingTestService. + * Long-running Operation for AutoRest. + */ +package fixtures.paging; diff --git a/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/Error.java b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/Error.java new file mode 100644 index 0000000000..7ff222fc44 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The code property. + */ + @JsonProperty(value = "code") + private Integer code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public Integer code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/ErrorException.java b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/ErrorException.java new file mode 100644 index 0000000000..effd4cf1e2 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/GroupsInner.java b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/GroupsInner.java new file mode 100644 index 0000000000..88f664f203 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/GroupsInner.java @@ -0,0 +1,141 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.subscriptionidapiversion.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Groups. + */ +public class GroupsInner { + /** The Retrofit service to perform REST calls. */ + private GroupsService service; + /** The service client containing this operation class. */ + private MicrosoftAzureTestUrlImpl client; + + /** + * Initializes an instance of GroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GroupsInner(Retrofit retrofit, MicrosoftAzureTestUrlImpl client) { + this.service = retrofit.create(GroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Groups to be + * used by Retrofit to perform actually REST calls. + */ + interface GroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.subscriptionidapiversion.Groups getSampleResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}") + Observable> getSampleResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SampleResourceGroupInner object if successful. + */ + public SampleResourceGroupInner getSampleResourceGroup(String resourceGroupName) { + return getSampleResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body(); + } + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSampleResourceGroupAsync(String resourceGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSampleResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SampleResourceGroupInner object + */ + public Observable getSampleResourceGroupAsync(String resourceGroupName) { + return getSampleResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1, SampleResourceGroupInner>() { + @Override + public SampleResourceGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Provides a resouce group with name 'testgroup101' and location 'West US'. + * + * @param resourceGroupName Resource Group name 'testgroup101'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SampleResourceGroupInner object + */ + public Observable> getSampleResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getSampleResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSampleResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSampleResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/MicrosoftAzureTestUrlImpl.java b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/MicrosoftAzureTestUrlImpl.java new file mode 100644 index 0000000000..725ac4e010 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/MicrosoftAzureTestUrlImpl.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the MicrosoftAzureTestUrlImpl class. + */ +public class MicrosoftAzureTestUrlImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Subscription Id. */ + private String subscriptionId; + + /** + * Gets Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription Id. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public MicrosoftAzureTestUrlImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** API Version with value '2014-04-01-preview'. */ + private String apiVersion; + + /** + * Gets API Version with value '2014-04-01-preview'. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public MicrosoftAzureTestUrlImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public MicrosoftAzureTestUrlImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public MicrosoftAzureTestUrlImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The GroupsInner object to access its operations. + */ + private GroupsInner groups; + + /** + * Gets the GroupsInner object to access its operations. + * @return the GroupsInner object. + */ + public GroupsInner groups() { + return this.groups; + } + + /** + * Initializes an instance of MicrosoftAzureTestUrl client. + * + * @param credentials the management credentials for Azure + */ + public MicrosoftAzureTestUrlImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com/", credentials); + } + + /** + * Initializes an instance of MicrosoftAzureTestUrl client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public MicrosoftAzureTestUrlImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of MicrosoftAzureTestUrl client. + * + * @param restClient the REST client to connect to Azure. + */ + public MicrosoftAzureTestUrlImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2014-04-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.groups = new GroupsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "MicrosoftAzureTestUrl", "2014-04-01-preview"); + } +} diff --git a/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/SampleResourceGroupInner.java b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/SampleResourceGroupInner.java new file mode 100644 index 0000000000..78464edf09 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/SampleResourceGroupInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.subscriptionidapiversion.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SampleResourceGroupInner model. + */ +public class SampleResourceGroupInner { + /** + * resource group name 'testgroup101'. + */ + @JsonProperty(value = "name") + private String name; + + /** + * resource group location 'West US'. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the SampleResourceGroupInner object itself. + */ + public SampleResourceGroupInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the SampleResourceGroupInner object itself. + */ + public SampleResourceGroupInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/package-info.java b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/package-info.java new file mode 100644 index 0000000000..c4f55dd890 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for MicrosoftAzureTestUrl. + * Some cool documentation. + */ +package fixtures.subscriptionidapiversion.implementation; diff --git a/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/package-info.java b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/package-info.java new file mode 100644 index 0000000000..f637222862 --- /dev/null +++ b/test/azurefluent/src/main/java/fixtures/subscriptionidapiversion/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for MicrosoftAzureTestUrl. + * Some cool documentation. + */ +package fixtures.subscriptionidapiversion; diff --git a/test/azurefluent/src/test/java/fixtures/azurecustombaseuri/AzureCustomBaseUriTests.java b/test/azurefluent/src/test/java/fixtures/azurecustombaseuri/AzureCustomBaseUriTests.java new file mode 100644 index 0000000000..acf033a1ba --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurecustombaseuri/AzureCustomBaseUriTests.java @@ -0,0 +1,64 @@ +package fixtures.azurecustombaseuri; + +import com.microsoft.rest.credentials.TokenCredentials; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.custombaseuri.implementation.AutoRestParameterizedHostTestClientImpl; + +public class AzureCustomBaseUriTests { + private static AutoRestParameterizedHostTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestParameterizedHostTestClientImpl(new TokenCredentials(null, UUID.randomUUID().toString())); + } + + // Positive test case + @Test + public void getEmptyWithValidCustomUri() throws Exception { + client.withHost("host:3000"); + client.paths().getEmpty("local"); + } + + @Test + public void getEmptyWithInvalidCustomUriAccountName() throws Exception { + try { + client.paths().getEmpty("bad"); + Assert.assertTrue(false); + } + catch (RuntimeException e) { + Assert.assertTrue(true); + } + } + + @Test + public void getEmptyWithInvalidCustomUriHostName() throws Exception { + try { + client.withHost("badhost"); + client.paths().getEmpty("local"); + Assert.assertTrue(false); + } + catch (RuntimeException e) { + Assert.assertTrue(true); + } + finally { + client.withHost("host.:3000"); + } + } + + @Test + public void getEmptyWithEmptyCustomUriAccountName() throws Exception { + try { + client.paths().getEmpty(null); + Assert.assertTrue(false); + } + catch (IllegalArgumentException e) { + Assert.assertTrue(true); + } + } +} diff --git a/test/azurefluent/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java b/test/azurefluent/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java new file mode 100644 index 0000000000..33fd5cad14 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azureparametergrouping/ParameterGroupingTests.java @@ -0,0 +1,58 @@ +package fixtures.azureparametergrouping; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.azureparametergrouping.implementation.AutoRestParameterGroupingTestServiceImpl; +import fixtures.azureparametergrouping.implementation.FirstParameterGroupInner; +import fixtures.azureparametergrouping.implementation.ParameterGroupingPostMultiParamGroupsSecondParamGroupInner; +import fixtures.azureparametergrouping.implementation.ParameterGroupingPostOptionalParametersInner; +import fixtures.azureparametergrouping.implementation.ParameterGroupingPostRequiredParametersInner; + + +public class ParameterGroupingTests { + private static AutoRestParameterGroupingTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestParameterGroupingTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void postRequired() throws Exception { + ParameterGroupingPostRequiredParametersInner params = new ParameterGroupingPostRequiredParametersInner(); + params.withBody(1234); + params.withPath("path"); + params.withQuery(21); + params.withCustomHeader("header"); + client.parameterGroupings().postRequired(params); + } + + @Test + public void postOptional() throws Exception { + ParameterGroupingPostOptionalParametersInner params = new ParameterGroupingPostOptionalParametersInner(); + params.withQuery(21); + params.withCustomHeader("header"); + client.parameterGroupings().postOptional(params); + } + + @Test + public void postMultipleParameterGroups() throws Exception { + FirstParameterGroupInner first = new FirstParameterGroupInner(); + first.withQueryOne(21); + first.withHeaderOne("header"); + ParameterGroupingPostMultiParamGroupsSecondParamGroupInner second = new ParameterGroupingPostMultiParamGroupsSecondParamGroupInner(); + second.withHeaderTwo("header2"); + second.withQueryTwo(42); + client.parameterGroupings().postMultiParamGroups(first, second); + } + + @Test + public void postParameterGroupWithSharedParameter() throws Exception { + FirstParameterGroupInner first = new FirstParameterGroupInner(); + first.withQueryOne(21); + first.withHeaderOne("header"); + client.parameterGroupings().postSharedParameterGroupObject(first); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/azurereport/CoverageReporter.java b/test/azurefluent/src/test/java/fixtures/azurereport/CoverageReporter.java new file mode 100644 index 0000000000..495bdde955 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurereport/CoverageReporter.java @@ -0,0 +1,38 @@ +package fixtures.azurereport; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import fixtures.azurereport.implementation.AutoRestReportServiceForAzureImpl; + +public final class CoverageReporter { + private static AutoRestReportServiceForAzureImpl client = new AutoRestReportServiceForAzureImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + + private CoverageReporter() { } + + public static void main(String[] args) throws Exception { + Map report = client.getReport(); + + // Pending URL encoding + report.put("AzureMethodQueryUrlEncoding", 1); + report.put("AzurePathQueryUrlEncoding", 1); + report.put("AzureSwaggerQueryUrlEncoding", 1); + + int total = report.size(); + int hit = 0; + List missing = new ArrayList(); + for (Map.Entry entry : report.entrySet()) { + if (entry.getValue() != 0) { + hit++; + } else { + missing.add(entry.getKey()); + } + } + System.out.println(hit + " out of " + total + " tests hit. Missing tests:"); + for (String scenario : missing) { + System.out.println(scenario); + } + } +} diff --git a/test/azurefluent/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java b/test/azurefluent/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java new file mode 100644 index 0000000000..ef33a385c0 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurespecials/ApiVersionDefaultTests.java @@ -0,0 +1,36 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +public class ApiVersionDefaultTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void getMethodGlobalValid() throws Exception { + client.apiVersionDefaults().getMethodGlobalValid(); + } + + @Test + public void getMethodGlobalNotProvidedValid() throws Exception { + client.apiVersionDefaults().getMethodGlobalNotProvidedValid(); + } + + @Test + public void getPathGlobalValid() throws Exception { + client.apiVersionDefaults().getPathGlobalValid(); + } + + @Test + public void getSwaggerGlobalValid() throws Exception { + client.apiVersionDefaults().getSwaggerGlobalValid(); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java b/test/azurefluent/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java new file mode 100644 index 0000000000..70e59503c1 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurespecials/ApiVersionLocalTests.java @@ -0,0 +1,36 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +public class ApiVersionLocalTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void getMethodLocalValid() throws Exception { + client.apiVersionLocals().getMethodLocalValid(); + } + + @Test + public void getMethodGlobalNotProvidedValid() throws Exception { + client.apiVersionLocals().getMethodLocalNull(null); + } + + @Test + public void getPathGlobalValid() throws Exception { + client.apiVersionLocals().getPathLocalValid(); + } + + @Test + public void getSwaggerGlobalValid() throws Exception { + client.apiVersionLocals().getSwaggerLocalValid(); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java b/test/azurefluent/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java new file mode 100644 index 0000000000..b02e2f43d4 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurespecials/HeaderOperationsTests.java @@ -0,0 +1,28 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.ServiceResponseWithHeaders; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; +import fixtures.azurespecials.implementation.HeaderCustomNamedRequestIdHeadersInner; + + +public class HeaderOperationsTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void customNamedRequestId() throws Exception { + ServiceResponseWithHeaders response = client.headers().customNamedRequestIdWithServiceResponseAsync("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0").toBlocking().last(); + Assert.assertEquals(200, response.response().code()); + Assert.assertEquals("123", response.headers().fooRequestId()); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java b/test/azurefluent/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java new file mode 100644 index 0000000000..71c9c58482 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurespecials/SkipUrlEncodingTests.java @@ -0,0 +1,58 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; +import fixtures.azurespecials.implementation.SkipUrlEncodingsInner; + +public class SkipUrlEncodingTests { + private static String baseUrl = "http://localhost:3000"; + private static String unencodedPath = "path1/path2/path3"; + private static String unencodedQuery = "value1&q2=value2&q3=value3"; + + private static SkipUrlEncodingsInner client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl(baseUrl, new BasicAuthenticationCredentials(null, null)).skipUrlEncodings(); + } + + @Test + public void getMethodPathValid() throws Exception { + client.getMethodPathValid(unencodedPath); + } + + @Test + public void getPathPathValid() throws Exception { + client.getPathPathValid(unencodedPath); + } + + @Test + public void getSwaggerPathValid() throws Exception { + client.getSwaggerPathValid(); + } + + @Ignore("Not supported by OkHttp: https://github.com/square/okhttp/issues/2623") + public void getMethodQueryValid() throws Exception { + client.getMethodQueryValid(unencodedQuery); + } + + @Ignore("Not supported by OkHttp: https://github.com/square/okhttp/issues/2623") + public void getPathQueryValid() throws Exception { + client.getPathQueryValid(unencodedQuery); + } + + @Ignore("Not supported by OkHttp: https://github.com/square/okhttp/issues/2623") + public void getSwaggerQueryValid() throws Exception { + client.getSwaggerQueryValid(); + } + + @Test + public void getMethodQueryNull() throws Exception { + client.getMethodQueryNull(null); + } + +} diff --git a/test/azurefluent/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java b/test/azurefluent/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java new file mode 100644 index 0000000000..67ce8a438a --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurespecials/SubscriptionInCredentialsTests.java @@ -0,0 +1,51 @@ +package fixtures.azurespecials; + +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.interceptors.RequestIdHeaderInterceptor; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.TokenCredentials; + +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +public class SubscriptionInCredentialsTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + RestClient restClient = new RestClient.Builder() + .withBaseUrl("http://localhost:3000") + .withCredentials(new TokenCredentials(null, UUID.randomUUID().toString())) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .withInterceptor(new RequestIdHeaderInterceptor()) + .build(); + client = new AutoRestAzureSpecialParametersTestClientImpl(restClient); + client.withSubscriptionId("1234-5678-9012-3456"); + } + + @Test + public void postMethodGlobalValid() throws Exception { + client.subscriptionInCredentials().postMethodGlobalValid(); + } + + @Test + public void postMethodGlobalNotProvidedValid() throws Exception { + client.subscriptionInCredentials().postMethodGlobalNotProvidedValid(); + } + + @Test + public void postPathGlobalValid() throws Exception { + client.subscriptionInCredentials().postPathGlobalValid(); + } + + @Test + public void postSwaggerGlobalValid() throws Exception { + client.subscriptionInCredentials().postSwaggerGlobalValid(); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java b/test/azurefluent/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java new file mode 100644 index 0000000000..cf4d33bf36 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurespecials/SubscriptionInMethodTests.java @@ -0,0 +1,59 @@ +package fixtures.azurespecials; + +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.interceptors.RequestIdHeaderInterceptor; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.credentials.TokenCredentials; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +import static org.junit.Assert.fail; + +public class SubscriptionInMethodTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + RestClient restClient = new RestClient.Builder() + .withBaseUrl("http://localhost:3000") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .withCredentials(new TokenCredentials(null, UUID.randomUUID().toString())) + .withInterceptor(new RequestIdHeaderInterceptor()) + .build(); + client = new AutoRestAzureSpecialParametersTestClientImpl(restClient); + client.withSubscriptionId("1234-5678-9012-3456"); + } + + @Test + public void postMethodLocalValid() throws Exception { + client.subscriptionInMethods().postMethodLocalValid("1234-5678-9012-3456"); + } + + @Test + public void postMethodLocalNull() throws Exception { + try { + client.subscriptionInMethods().postMethodLocalNull(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter subscriptionId is required")); + } + } + + @Test + public void postPathLocalValid() throws Exception { + client.subscriptionInMethods().postPathLocalValid("1234-5678-9012-3456"); + } + + @Test + public void postSwaggerLocalValid() throws Exception { + client.subscriptionInMethods().postSwaggerLocalValid("1234-5678-9012-3456"); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java b/test/azurefluent/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java new file mode 100644 index 0000000000..3e33038e0f --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/azurespecials/XMsClientRequestIdTests.java @@ -0,0 +1,33 @@ +package fixtures.azurespecials; + +import com.microsoft.rest.credentials.TokenCredentials; + +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.azurespecials.implementation.AutoRestAzureSpecialParametersTestClientImpl; + +public class XMsClientRequestIdTests { + private static AutoRestAzureSpecialParametersTestClientImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestAzureSpecialParametersTestClientImpl("http://localhost.:3000", new TokenCredentials(null, UUID.randomUUID().toString())); + client.withSubscriptionId("1234-5678-9012-3456"); + } + + @Test + public void get() throws Exception { + client.restClient().headers().addHeader("x-ms-client-request-id", "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0"); + client.xMsClientRequestIds().get(); + client.restClient().headers().removeHeader("x-ms-client-request-id"); + } + + @Test + public void paramGet() throws Exception { + client.restClient().headers().removeHeader("x-ms-client-request-id"); + client.xMsClientRequestIds().paramGet("9C4D50EE-2D56-4CD3-8152-34347DC9F2B0"); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/head/HttpSuccessTests.java b/test/azurefluent/src/test/java/fixtures/head/HttpSuccessTests.java new file mode 100644 index 0000000000..b545d5bf45 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/head/HttpSuccessTests.java @@ -0,0 +1,32 @@ +package fixtures.head; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.head.implementation.AutoRestHeadTestServiceImpl; + +public class HttpSuccessTests { + private static AutoRestHeadTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestHeadTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void head200() throws Exception { + Assert.assertTrue(client.httpSuccess().head200()); + } + + @Test + public void head204() throws Exception { + Assert.assertTrue(client.httpSuccess().head204()); + } + + @Test + public void head404() throws Exception { + Assert.assertFalse(client.httpSuccess().head404()); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/headexceptions/HeadExceptionTests.java b/test/azurefluent/src/test/java/fixtures/headexceptions/HeadExceptionTests.java new file mode 100644 index 0000000000..f1b635888c --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/headexceptions/HeadExceptionTests.java @@ -0,0 +1,31 @@ +package fixtures.headexceptions; + +import com.microsoft.rest.RestException; +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import fixtures.headexceptions.implementation.AutoRestHeadExceptionTestServiceImpl; +import org.junit.BeforeClass; +import org.junit.Test; + +public class HeadExceptionTests { + private static AutoRestHeadExceptionTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestHeadExceptionTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void headException200() throws Exception { + client.headExceptions().head200(); + } + + @Test + public void headException204() throws Exception { + client.headExceptions().head204(); + } + + @Test(expected = RestException.class) + public void headException404() throws Exception { + client.headExceptions().head404(); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/lro/LRORetrysTests.java b/test/azurefluent/src/test/java/fixtures/lro/LRORetrysTests.java new file mode 100644 index 0000000000..f74d2b0e62 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/lro/LRORetrysTests.java @@ -0,0 +1,66 @@ +package fixtures.lro; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl; +import fixtures.lro.implementation.ProductInner; + + +public class LRORetrysTests { + private static AutoRestLongRunningOperationTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + } + + @Test + public void put201CreatingSucceeded200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lRORetrys().put201CreatingSucceeded200(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncRelativeRetrySucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lRORetrys().putAsyncRelativeRetrySucceeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void deleteProvisioning202Accepted200Succeeded() throws Exception { + ProductInner response = client.lRORetrys().deleteProvisioning202Accepted200Succeeded(); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void delete202Retry200() throws Exception { + client.lRORetrys().delete202Retry200(); + } + + @Test + public void deleteAsyncRelativeRetrySucceeded() throws Exception { + client.lRORetrys().deleteAsyncRelativeRetrySucceeded(); + } + + @Test + public void post202Retry200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + client.lRORetrys().post202Retry200(product); + } + + @Test + public void postAsyncRelativeRetrySucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + client.lRORetrys().postAsyncRelativeRetrySucceeded(product); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/lro/LROSADsTests.java b/test/azurefluent/src/test/java/fixtures/lro/LROSADsTests.java new file mode 100644 index 0000000000..57712d3578 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/lro/LROSADsTests.java @@ -0,0 +1,306 @@ +package fixtures.lro; + +import com.microsoft.azure.CloudException; +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl; +import fixtures.lro.implementation.ProductInner; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import static org.junit.Assert.fail; + +public class LROSADsTests { + private static AutoRestLongRunningOperationTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + } + + @Test + public void putNonRetry400() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().putNonRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void putNonRetry201Creating400() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().putNonRetry201Creating400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void putAsyncRelativeRetry400() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void deleteNonRetry400() throws Exception { + try { + client.lROSADs().deleteNonRetry400(); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void delete202NonRetry400() throws Exception { + try { + client.lROSADs().delete202NonRetry400(); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void deleteAsyncRelativeRetry400() throws Exception { + try { + client.lROSADs().deleteAsyncRelativeRetry400(); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void postNonRetry400() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().postNonRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void post202NonRetry400() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().post202NonRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void postAsyncRelativeRetry400() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().postAsyncRelativeRetry400(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void putError201NoProvisioningStatePayload() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().putError201NoProvisioningStatePayload(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void putAsyncRelativeRetryNoStatus() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetryNoStatus(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void putAsyncRelativeRetryNoStatusPayload() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetryNoStatusPayload(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void delete204Succeeded() throws Exception { + client.lROSADs().delete204Succeeded(); + } + + @Test + public void deleteAsyncRelativeRetryNoStatus() throws Exception { + try { + client.lROSADs().deleteAsyncRelativeRetryNoStatus(); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void post202NoLocation() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().post202NoLocation(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(202, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("Response does not contain an Azure")); + } + } + + @Test + public void postAsyncRelativeRetryNoPayload() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().postAsyncRelativeRetryNoPayload(product); + fail(); + } catch (CloudException ex) { + Assert.assertEquals(200, ex.response().code()); + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void put200InvalidJson() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().put200InvalidJson(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("Unexpected end-of-input")); + } + } + + @Test + public void putAsyncRelativeRetryInvalidHeader() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetryInvalidHeader(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void putAsyncRelativeRetryInvalidJsonPolling() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().putAsyncRelativeRetryInvalidJsonPolling(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void delete202RetryInvalidHeader() throws Exception { + try { + client.lROSADs().delete202RetryInvalidHeader(); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void deleteAsyncRelativeRetryInvalidHeader() throws Exception { + try { + client.lROSADs().deleteAsyncRelativeRetryInvalidHeader(); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void deleteAsyncRelativeRetryInvalidJsonPolling() throws Exception { + try { + client.lROSADs().deleteAsyncRelativeRetryInvalidJsonPolling(); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } + + @Test + public void post202RetryInvalidHeader() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().post202RetryInvalidHeader(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void postAsyncRelativeRetryInvalidHeader() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().postAsyncRelativeRetryInvalidHeader(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("no protocol: /foo")); + } + } + + @Test + public void postAsyncRelativeRetryInvalidJsonPolling() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + client.lROSADs().postAsyncRelativeRetryInvalidJsonPolling(product); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("does not contain a valid body")); + } + } +} diff --git a/test/azurefluent/src/test/java/fixtures/lro/LROsCustomHeaderTests.java b/test/azurefluent/src/test/java/fixtures/lro/LROsCustomHeaderTests.java new file mode 100644 index 0000000000..84f3a9d341 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/lro/LROsCustomHeaderTests.java @@ -0,0 +1,56 @@ +package fixtures.lro; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Ignore; + +import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl; +import fixtures.lro.implementation.ProductInner; + +public class LROsCustomHeaderTests { + private static AutoRestLongRunningOperationTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestLongRunningOperationTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + client.restClient().headers().addHeader("x-ms-client-request-id", "9C4D50EE-2D56-4CD3-8152-34347DC9F2B0"); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + } + + @AfterClass + public static void cleanup() { + client.restClient().headers().removeHeader("x-ms-client-request-id"); + } + + @Ignore("Pending headermap") + public void putAsyncRetrySucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROsCustomHeaders().putAsyncRetrySucceeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Ignore("Pending headermap") + public void put201CreatingSucceeded200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROsCustomHeaders().put201CreatingSucceeded200(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Ignore("Pending headermap") + public void post202Retry200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + client.lROsCustomHeaders().post202Retry200(product); + } + + @Ignore("Pending headermap") + public void postAsyncRetrySucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + client.lROsCustomHeaders().postAsyncRetrySucceeded(product); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/lro/LROsTests.java b/test/azurefluent/src/test/java/fixtures/lro/LROsTests.java new file mode 100644 index 0000000000..6fca839911 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/lro/LROsTests.java @@ -0,0 +1,376 @@ +package fixtures.lro; + +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import fixtures.lro.implementation.AutoRestLongRunningOperationTestServiceImpl; +import fixtures.lro.implementation.ProductInner; +import fixtures.lro.implementation.SkuInner; +import fixtures.lro.implementation.SubProductInner; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import rx.Observable; +import rx.Subscriber; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.fail; + +public class LROsTests { + private static AutoRestLongRunningOperationTestServiceImpl client; + + @BeforeClass + public static void setup() { + RestClient restClient = new RestClient.Builder() + .withBaseUrl("http://localhost:3000") + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(); + client = new AutoRestLongRunningOperationTestServiceImpl(restClient); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + } + + @Test + public void put200Succeeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().put200Succeeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void put200SucceededAsync() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + Observable.from(client.lROs().put200SucceededAsync(product, null)) + .subscribe(new Subscriber() { + @Override + public void onCompleted() { + System.out.println("completed"); + } + + @Override + public void onError(Throwable e) { + System.out.println("error" + e); + } + + @Override + public void onNext(ProductInner productInnerServiceResponse) { + System.out.println(productInnerServiceResponse.provisioningState()); + } + }); + System.out.println("Checkpoint"); + } + + @Test + public void put200AsyncSucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().put200SucceededAsync(product, null).get(); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void put200SucceededNoState() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().put200SucceededNoState(product); + Assert.assertEquals("100", response.id()); + } + + @Test + public void put202Retry200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().put202Retry200(product); + Assert.assertEquals("100", response.id()); + } + + @Ignore("Can cause flakiness - only run manually") + public void put202Retry200Async() throws Exception { + final CountDownLatch lock = new CountDownLatch(1); + long startTime = System.currentTimeMillis(); + final long[] callbackTime = new long[1]; + ProductInner product = new ProductInner(); + product.withLocation("West US"); + client.getAzureClient().setLongRunningOperationRetryTimeout(1); + client.lROs().put202Retry200Async(product, new ServiceCallback() { + @Override + public void failure(Throwable t) { + fail(); + } + + @Override + public void success(ProductInner result) { + Assert.assertEquals("100", result.id()); + callbackTime[0] = System.currentTimeMillis(); + lock.countDown(); + } + }); + long endTime = System.currentTimeMillis(); + Assert.assertTrue(500 > endTime - startTime); + Assert.assertTrue(lock.await(3000, TimeUnit.MILLISECONDS)); + client.getAzureClient().setLongRunningOperationRetryTimeout(0); + Assert.assertTrue(1000 < callbackTime[0] - startTime); + } + + @Test + public void put201CreatingSucceeded200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().put201CreatingSucceeded200(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void put200UpdatingSucceeded204() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().put200UpdatingSucceeded204(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void put201CreatingFailed200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + ProductInner response = client.lROs().put201CreatingFailed200(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage()); + } + } + + @Test + public void put200Acceptedcanceled200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + ProductInner response = client.lROs().put200Acceptedcanceled200(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage()); + } + } + + @Test + public void putNoHeaderInRetry() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().putNoHeaderInRetry(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncRetrySucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().putAsyncRetrySucceeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncNoRetrySucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().putAsyncNoRetrySucceeded(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncRetryFailed() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + ProductInner response = client.lROs().putAsyncRetryFailed(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage()); + } + } + + @Test + public void putAsyncNoRetrycanceled() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + try { + ProductInner response = client.lROs().putAsyncNoRetrycanceled(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage()); + } + } + + @Test + public void putAsyncNoHeaderInRetry() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().putAsyncNoHeaderInRetry(product); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putNonResource() throws Exception { + SkuInner sku = new SkuInner(); + SkuInner response = client.lROs().putNonResource(sku); + Assert.assertEquals("100", response.id()); + } + + @Test + public void putAsyncNonResource() throws Exception { + SkuInner sku = new SkuInner(); + SkuInner response = client.lROs().putAsyncNonResource(sku); + Assert.assertEquals("100", response.id()); + } + + @Test + public void putSubResource() throws Exception { + SubProductInner subProduct = new SubProductInner(); + SubProductInner response = client.lROs().putSubResource(subProduct); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void putAsyncSubResource() throws Exception { + SubProductInner subProduct = new SubProductInner(); + SubProductInner response = client.lROs().putAsyncSubResource(subProduct); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void deleteProvisioning202Accepted200Succeeded() throws Exception { + ProductInner response = client.lROs().deleteProvisioning202Accepted200Succeeded(); + Assert.assertEquals("Succeeded", response.provisioningState()); + } + + @Test + public void deleteProvisioning202DeletingFailed200() throws Exception { + ProductInner response = client.lROs().deleteProvisioning202DeletingFailed200(); + Assert.assertEquals("Failed", response.provisioningState()); + } + + @Test + public void deleteProvisioning202Deletingcanceled200() throws Exception { + ProductInner response = client.lROs().deleteProvisioning202Deletingcanceled200(); + Assert.assertEquals("Canceled", response.provisioningState()); + } + + @Test + public void delete204Succeeded() throws Exception { + client.lROs().delete204Succeeded(); + } + + @Test + public void delete202Retry200() throws Exception { + ProductInner response = client.lROs().delete202Retry200(); + } + + @Test + public void delete202NoRetry204() throws Exception { + ProductInner response = client.lROs().delete202NoRetry204(); + } + + @Test + public void deleteNoHeaderInRetry() throws Exception { + client.lROs().deleteNoHeaderInRetry(); + } + + @Test + public void deleteAsyncNoHeaderInRetry() throws Exception { + client.lROs().deleteAsyncNoHeaderInRetry(); + } + + @Test + public void deleteAsyncRetrySucceeded() throws Exception { + client.lROs().deleteAsyncRetrySucceeded(); + } + + @Test + public void deleteAsyncNoRetrySucceeded() throws Exception { + client.lROs().deleteAsyncNoRetrySucceeded(); + } + + @Test + public void deleteAsyncRetryFailed() throws Exception { + try { + client.lROs().deleteAsyncRetryFailed(); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage()); + } + } + + @Test + public void deleteAsyncRetrycanceled() throws Exception { + try { + client.lROs().deleteAsyncRetrycanceled(); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage()); + } + } + + @Test + public void post200WithPayload() throws Exception { + SkuInner response = client.lROs().post200WithPayload(); + Assert.assertEquals("1", response.id()); + } + + @Test + public void post202Retry200() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + client.lROs().post202Retry200(product); + } + + @Test + public void post202NoRetry204() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().post202NoRetry204(product); + } + + @Test + public void postAsyncRetrySucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().postAsyncRetrySucceeded(product); + } + + @Test + public void postAsyncNoRetrySucceeded() throws Exception { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + ProductInner response = client.lROs().postAsyncNoRetrySucceeded(product); + } + + @Test + public void postAsyncRetryFailed() throws Exception { + try { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + client.lROs().postAsyncRetryFailed(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Failed", e.getMessage()); + } + } + + @Test + public void postAsyncRetrycanceled() throws Exception { + try { + ProductInner product = new ProductInner(); + product.withLocation("West US"); + client.lROs().postAsyncRetrycanceled(product); + fail(); + } catch (CloudException e) { + Assert.assertEquals("Async operation failed with provisioning state: Canceled", e.getMessage()); + } + } +} diff --git a/test/azurefluent/src/test/java/fixtures/paging/PagingTests.java b/test/azurefluent/src/test/java/fixtures/paging/PagingTests.java new file mode 100644 index 0000000000..9842755eb8 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/paging/PagingTests.java @@ -0,0 +1,128 @@ +package fixtures.paging; + +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import fixtures.paging.implementation.AutoRestPagingTestServiceImpl; +import fixtures.paging.implementation.PagingGetMultiplePagesWithOffsetOptionsInner; +import fixtures.paging.implementation.ProductInner; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.fail; + +public class PagingTests { + private static AutoRestPagingTestServiceImpl client; + + @BeforeClass + public static void setup() { + client = new AutoRestPagingTestServiceImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void getSinglePages() throws Exception { + List response = client.pagings().getSinglePages(); + Assert.assertEquals(1, response.size()); + } + + @Test + public void getMultiplePages() throws Exception { + List response = client.pagings().getMultiplePages(); + ProductInner p1 = new ProductInner(); + p1.withProperties(new ProductProperties()); + response.add(p1); + response.get(3); + ProductInner p4 = new ProductInner(); + p4.withProperties(new ProductProperties()); + response.add(p4); + int i = 0; + for (ProductInner p : response) { + if (++i == 7) { + break; + } + } + System.out.println("Asserting..."); + Assert.assertEquals(12, response.size()); + Assert.assertEquals(1, response.indexOf(p1)); + Assert.assertEquals(4, response.indexOf(p4)); + } + + @Test + public void getMultiplePagesWithOffset() throws Exception { + PagingGetMultiplePagesWithOffsetOptionsInner options = new PagingGetMultiplePagesWithOffsetOptionsInner(); + options.withOffset(100); + List response = client.pagings().getMultiplePagesWithOffset(options, "client-id"); + Assert.assertEquals(10, response.size()); + Assert.assertEquals(110, (int) response.get(response.size() - 1).properties().id()); + } + + @Test + public void getMultiplePagesAsync() throws Exception { + final CountDownLatch lock = new CountDownLatch(1); + client.pagings().getMultiplePagesAsync("client-id", null, new ListOperationCallback() { + @Override + public void failure(Throwable t) { + fail(); + } + + @Override + public void success() { + lock.countDown(); + } + + @Override + public PagingBehavior progress(List partial) { + if (pageCount() == 7) { + return PagingBehavior.STOP; + } else { + return PagingBehavior.CONTINUE; + } + } + }); + Assert.assertTrue(lock.await(10000, TimeUnit.MILLISECONDS)); + } + + @Test + public void getMultiplePagesRetryFirst() throws Exception { + List response = client.pagings().getMultiplePagesRetryFirst(); + Assert.assertEquals(10, response.size()); + } + + @Test + public void getMultiplePagesRetrySecond() throws Exception { + List response = client.pagings().getMultiplePagesRetrySecond(); + Assert.assertEquals(10, response.size()); + } + + @Test + public void getSinglePagesFailure() throws Exception { + try { + List response = client.pagings().getSinglePagesFailure(); + fail(); + } catch (CloudException ex) { + Assert.assertNotNull(ex.response()); + } + } + + @Test + public void getMultiplePagesFailure() throws Exception { + try { + List response = client.pagings().getMultiplePagesFailure(); + response.size(); + fail(); + } catch (CloudException ex) { + Assert.assertNotNull(ex.response()); + } + } + + @Test + public void getMultiplePagesFailureUri() throws Exception { + List response = client.pagings().getMultiplePagesFailureUri(); + Assert.assertEquals(1, response.size()); + } +} diff --git a/test/azurefluent/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java b/test/azurefluent/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java new file mode 100644 index 0000000000..50279a2229 --- /dev/null +++ b/test/azurefluent/src/test/java/fixtures/subscriptionidapiversion/GroupTests.java @@ -0,0 +1,28 @@ +package fixtures.subscriptionidapiversion; + +import com.microsoft.rest.credentials.BasicAuthenticationCredentials; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.UUID; + +import fixtures.subscriptionidapiversion.implementation.MicrosoftAzureTestUrlImpl; +import fixtures.subscriptionidapiversion.implementation.SampleResourceGroupInner; + +public class GroupTests { + private static MicrosoftAzureTestUrlImpl client; + + @BeforeClass + public static void setup() { + client = new MicrosoftAzureTestUrlImpl("http://localhost:3000", new BasicAuthenticationCredentials(null, null)); + } + + @Test + public void getSampleResourceGroup() throws Exception { + client.withSubscriptionId(UUID.randomUUID().toString()); + SampleResourceGroupInner group = client.groups().getSampleResourceGroup("testgroup101"); + Assert.assertEquals("testgroup101", group.name()); + Assert.assertEquals("West US", group.location()); + } +} diff --git a/test/vanilla/pom.xml b/test/vanilla/pom.xml new file mode 100644 index 0000000000..e4fa373cfd --- /dev/null +++ b/test/vanilla/pom.xml @@ -0,0 +1,150 @@ + + + 4.0.0 + + com.microsoft.azure + autorest-java + 1.0.0-SNAPSHOT + ../../pom.xml + + + codegen-tests + jar + + AutoRest Java Code Generator Tests + This package contains the tests for the generic Java code generator. + https://github.com/Azure/autorest + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + scm:git:https://github.com/Azure/autorest + scm:git:git@github.com:Azure/autorest.git + HEAD + + + + UTF-8 + + + + + + microsoft + Microsoft + + + + + + com.microsoft.rest + client-runtime + + + commons-codec + commons-codec + + + commons-io + commons-io + test + + + org.slf4j + slf4j-simple + test + + + junit + junit + test + + + junit + junit-dep + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + org.codehaus.mojo + build-helper-maven-plugin + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.storage + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/]]>
+
+
+ + + exec-maven-plugin + org.codehaus.mojo + 1.5.0 + + + run-server + test-compile + + exec + + + node + ${session.executionRootDirectory} + + node_modules/@microsoft.azure/autorest.testserver + + true + + + + report-coverage + test + + java + + + fixtures.report.CoverageReporter + test + false + + + + +
+
+
diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/Arrays.java b/test/vanilla/src/main/java/fixtures/bodyarray/Arrays.java new file mode 100644 index 0000000000..cf21b35e3d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/Arrays.java @@ -0,0 +1,2355 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyarray; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyarray.models.ErrorException; +import fixtures.bodyarray.models.Product; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Arrays. + */ +public interface Arrays { + /** + * Get null array value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + List getNull(); + + /** + * Get null array value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get null array value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable> getNullAsync(); + + /** + * Get null array value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable>> getNullWithServiceResponseAsync(); + + /** + * Get invalid array [1, 2, 3. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + List getInvalid(); + + /** + * Get invalid array [1, 2, 3. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getInvalidAsync(final ServiceCallback> serviceCallback); + + /** + * Get invalid array [1, 2, 3. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable> getInvalidAsync(); + + /** + * Get invalid array [1, 2, 3. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable>> getInvalidWithServiceResponseAsync(); + + /** + * Get empty array value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + List getEmpty(); + + /** + * Get empty array value []. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getEmptyAsync(final ServiceCallback> serviceCallback); + + /** + * Get empty array value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable> getEmptyAsync(); + + /** + * Get empty array value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable>> getEmptyWithServiceResponseAsync(); + + /** + * Set array value empty []. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putEmpty(List arrayBody); + + /** + * Set array value empty []. + * + * @param arrayBody the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putEmptyAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value empty []. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putEmptyAsync(List arrayBody); + + /** + * Set array value empty []. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putEmptyWithServiceResponseAsync(List arrayBody); + + /** + * Get boolean array value [true, false, false, true]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Boolean> object if successful. + */ + List getBooleanTfft(); + + /** + * Get boolean array value [true, false, false, true]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getBooleanTfftAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean array value [true, false, false, true]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + Observable> getBooleanTfftAsync(); + + /** + * Get boolean array value [true, false, false, true]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + Observable>> getBooleanTfftWithServiceResponseAsync(); + + /** + * Set array value empty [true, false, false, true]. + * + * @param arrayBody the List<Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBooleanTfft(List arrayBody); + + /** + * Set array value empty [true, false, false, true]. + * + * @param arrayBody the List<Boolean> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBooleanTfftAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value empty [true, false, false, true]. + * + * @param arrayBody the List<Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBooleanTfftAsync(List arrayBody); + + /** + * Set array value empty [true, false, false, true]. + * + * @param arrayBody the List<Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBooleanTfftWithServiceResponseAsync(List arrayBody); + + /** + * Get boolean array value [true, null, false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Boolean> object if successful. + */ + List getBooleanInvalidNull(); + + /** + * Get boolean array value [true, null, false]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getBooleanInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean array value [true, null, false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + Observable> getBooleanInvalidNullAsync(); + + /** + * Get boolean array value [true, null, false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + Observable>> getBooleanInvalidNullWithServiceResponseAsync(); + + /** + * Get boolean array value [true, 'boolean', false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Boolean> object if successful. + */ + List getBooleanInvalidString(); + + /** + * Get boolean array value [true, 'boolean', false]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getBooleanInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean array value [true, 'boolean', false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + Observable> getBooleanInvalidStringAsync(); + + /** + * Get boolean array value [true, 'boolean', false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + Observable>> getBooleanInvalidStringWithServiceResponseAsync(); + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + List getIntegerValid(); + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getIntegerValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable> getIntegerValidAsync(); + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable>> getIntegerValidWithServiceResponseAsync(); + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putIntegerValid(List arrayBody); + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Integer> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putIntegerValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putIntegerValidAsync(List arrayBody); + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putIntegerValidWithServiceResponseAsync(List arrayBody); + + /** + * Get integer array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + List getIntInvalidNull(); + + /** + * Get integer array value [1, null, 0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getIntInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable> getIntInvalidNullAsync(); + + /** + * Get integer array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable>> getIntInvalidNullWithServiceResponseAsync(); + + /** + * Get integer array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + List getIntInvalidString(); + + /** + * Get integer array value [1, 'integer', 0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getIntInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable> getIntInvalidStringAsync(); + + /** + * Get integer array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + Observable>> getIntInvalidStringWithServiceResponseAsync(); + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Long> object if successful. + */ + List getLongValid(); + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getLongValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + Observable> getLongValidAsync(); + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + Observable>> getLongValidWithServiceResponseAsync(); + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putLongValid(List arrayBody); + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Long> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putLongValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putLongValidAsync(List arrayBody); + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putLongValidWithServiceResponseAsync(List arrayBody); + + /** + * Get long array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Long> object if successful. + */ + List getLongInvalidNull(); + + /** + * Get long array value [1, null, 0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getLongInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get long array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + Observable> getLongInvalidNullAsync(); + + /** + * Get long array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + Observable>> getLongInvalidNullWithServiceResponseAsync(); + + /** + * Get long array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Long> object if successful. + */ + List getLongInvalidString(); + + /** + * Get long array value [1, 'integer', 0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getLongInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get long array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + Observable> getLongInvalidStringAsync(); + + /** + * Get long array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + Observable>> getLongInvalidStringWithServiceResponseAsync(); + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + List getFloatValid(); + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getFloatValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable> getFloatValidAsync(); + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable>> getFloatValidWithServiceResponseAsync(); + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putFloatValid(List arrayBody); + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putFloatValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putFloatValidAsync(List arrayBody); + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putFloatValidWithServiceResponseAsync(List arrayBody); + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + List getFloatInvalidNull(); + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getFloatInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable> getFloatInvalidNullAsync(); + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable>> getFloatInvalidNullWithServiceResponseAsync(); + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + List getFloatInvalidString(); + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getFloatInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable> getFloatInvalidStringAsync(); + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable>> getFloatInvalidStringWithServiceResponseAsync(); + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + List getDoubleValid(); + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDoubleValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable> getDoubleValidAsync(); + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable>> getDoubleValidWithServiceResponseAsync(); + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDoubleValid(List arrayBody); + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDoubleValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDoubleValidAsync(List arrayBody); + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDoubleValidWithServiceResponseAsync(List arrayBody); + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + List getDoubleInvalidNull(); + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDoubleInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable> getDoubleInvalidNullAsync(); + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable>> getDoubleInvalidNullWithServiceResponseAsync(); + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + List getDoubleInvalidString(); + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDoubleInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable> getDoubleInvalidStringAsync(); + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + Observable>> getDoubleInvalidStringWithServiceResponseAsync(); + + /** + * Get string array value ['foo1', 'foo2', 'foo3']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<String> object if successful. + */ + List getStringValid(); + + /** + * Get string array value ['foo1', 'foo2', 'foo3']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStringValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get string array value ['foo1', 'foo2', 'foo3']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + Observable> getStringValidAsync(); + + /** + * Get string array value ['foo1', 'foo2', 'foo3']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + Observable>> getStringValidWithServiceResponseAsync(); + + /** + * Set array value ['foo1', 'foo2', 'foo3']. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putStringValid(List arrayBody); + + /** + * Set array value ['foo1', 'foo2', 'foo3']. + * + * @param arrayBody the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putStringValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value ['foo1', 'foo2', 'foo3']. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putStringValidAsync(List arrayBody); + + /** + * Set array value ['foo1', 'foo2', 'foo3']. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putStringValidWithServiceResponseAsync(List arrayBody); + + /** + * Get string array value ['foo', null, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<String> object if successful. + */ + List getStringWithNull(); + + /** + * Get string array value ['foo', null, 'foo2']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStringWithNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get string array value ['foo', null, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + Observable> getStringWithNullAsync(); + + /** + * Get string array value ['foo', null, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + Observable>> getStringWithNullWithServiceResponseAsync(); + + /** + * Get string array value ['foo', 123, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<String> object if successful. + */ + List getStringWithInvalid(); + + /** + * Get string array value ['foo', 123, 'foo2']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStringWithInvalidAsync(final ServiceCallback> serviceCallback); + + /** + * Get string array value ['foo', 123, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + Observable> getStringWithInvalidAsync(); + + /** + * Get string array value ['foo', 123, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + Observable>> getStringWithInvalidWithServiceResponseAsync(); + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<UUID> object if successful. + */ + List getUuidValid(); + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getUuidValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UUID> object + */ + Observable> getUuidValidAsync(); + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UUID> object + */ + Observable>> getUuidValidWithServiceResponseAsync(); + + /** + * Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param arrayBody the List<UUID> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putUuidValid(List arrayBody); + + /** + * Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param arrayBody the List<UUID> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putUuidValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param arrayBody the List<UUID> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putUuidValidAsync(List arrayBody); + + /** + * Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param arrayBody the List<UUID> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putUuidValidWithServiceResponseAsync(List arrayBody); + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<UUID> object if successful. + */ + List getUuidInvalidChars(); + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getUuidInvalidCharsAsync(final ServiceCallback> serviceCallback); + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UUID> object + */ + Observable> getUuidInvalidCharsAsync(); + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UUID> object + */ + Observable>> getUuidInvalidCharsWithServiceResponseAsync(); + + /** + * Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<LocalDate> object if successful. + */ + List getDateValid(); + + /** + * Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + Observable> getDateValidAsync(); + + /** + * Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + Observable>> getDateValidWithServiceResponseAsync(); + + /** + * Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param arrayBody the List<LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDateValid(List arrayBody); + + /** + * Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param arrayBody the List<LocalDate> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param arrayBody the List<LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateValidAsync(List arrayBody); + + /** + * Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param arrayBody the List<LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateValidWithServiceResponseAsync(List arrayBody); + + /** + * Get date array value ['2012-01-01', null, '1776-07-04']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<LocalDate> object if successful. + */ + List getDateInvalidNull(); + + /** + * Get date array value ['2012-01-01', null, '1776-07-04']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get date array value ['2012-01-01', null, '1776-07-04']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + Observable> getDateInvalidNullAsync(); + + /** + * Get date array value ['2012-01-01', null, '1776-07-04']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + Observable>> getDateInvalidNullWithServiceResponseAsync(); + + /** + * Get date array value ['2011-03-22', 'date']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<LocalDate> object if successful. + */ + List getDateInvalidChars(); + + /** + * Get date array value ['2011-03-22', 'date']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateInvalidCharsAsync(final ServiceCallback> serviceCallback); + + /** + * Get date array value ['2011-03-22', 'date']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + Observable> getDateInvalidCharsAsync(); + + /** + * Get date array value ['2011-03-22', 'date']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + Observable>> getDateInvalidCharsWithServiceResponseAsync(); + + /** + * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DateTime> object if successful. + */ + List getDateTimeValid(); + + /** + * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateTimeValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + Observable> getDateTimeValidAsync(); + + /** + * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + Observable>> getDateTimeValidWithServiceResponseAsync(); + + /** + * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param arrayBody the List<DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDateTimeValid(List arrayBody); + + /** + * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param arrayBody the List<DateTime> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateTimeValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param arrayBody the List<DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateTimeValidAsync(List arrayBody); + + /** + * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param arrayBody the List<DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateTimeValidWithServiceResponseAsync(List arrayBody); + + /** + * Get date array value ['2000-12-01t00:00:01z', null]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DateTime> object if successful. + */ + List getDateTimeInvalidNull(); + + /** + * Get date array value ['2000-12-01t00:00:01z', null]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateTimeInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get date array value ['2000-12-01t00:00:01z', null]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + Observable> getDateTimeInvalidNullAsync(); + + /** + * Get date array value ['2000-12-01t00:00:01z', null]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + Observable>> getDateTimeInvalidNullWithServiceResponseAsync(); + + /** + * Get date array value ['2000-12-01t00:00:01z', 'date-time']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DateTime> object if successful. + */ + List getDateTimeInvalidChars(); + + /** + * Get date array value ['2000-12-01t00:00:01z', 'date-time']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateTimeInvalidCharsAsync(final ServiceCallback> serviceCallback); + + /** + * Get date array value ['2000-12-01t00:00:01z', 'date-time']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + Observable> getDateTimeInvalidCharsAsync(); + + /** + * Get date array value ['2000-12-01t00:00:01z', 'date-time']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + Observable>> getDateTimeInvalidCharsWithServiceResponseAsync(); + + /** + * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DateTime> object if successful. + */ + List getDateTimeRfc1123Valid(); + + /** + * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateTimeRfc1123ValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + Observable> getDateTimeRfc1123ValidAsync(); + + /** + * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + Observable>> getDateTimeRfc1123ValidWithServiceResponseAsync(); + + /** + * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param arrayBody the List<DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDateTimeRfc1123Valid(List arrayBody); + + /** + * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param arrayBody the List<DateTimeRfc1123> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateTimeRfc1123ValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param arrayBody the List<DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateTimeRfc1123ValidAsync(List arrayBody); + + /** + * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param arrayBody the List<DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateTimeRfc1123ValidWithServiceResponseAsync(List arrayBody); + + /** + * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Period> object if successful. + */ + List getDurationValid(); + + /** + * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDurationValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Period> object + */ + Observable> getDurationValidAsync(); + + /** + * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Period> object + */ + Observable>> getDurationValidWithServiceResponseAsync(); + + /** + * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param arrayBody the List<Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDurationValid(List arrayBody); + + /** + * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param arrayBody the List<Period> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDurationValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param arrayBody the List<Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDurationValidAsync(List arrayBody); + + /** + * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param arrayBody the List<Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDurationValidWithServiceResponseAsync(List arrayBody); + + /** + * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<byte[]> object if successful. + */ + List getByteValid(); + + /** + * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getByteValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + Observable> getByteValidAsync(); + + /** + * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + Observable>> getByteValidWithServiceResponseAsync(); + + /** + * Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each elementencoded in base 64. + * + * @param arrayBody the List<byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putByteValid(List arrayBody); + + /** + * Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each elementencoded in base 64. + * + * @param arrayBody the List<byte[]> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putByteValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each elementencoded in base 64. + * + * @param arrayBody the List<byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putByteValidAsync(List arrayBody); + + /** + * Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each elementencoded in base 64. + * + * @param arrayBody the List<byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putByteValidWithServiceResponseAsync(List arrayBody); + + /** + * Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<byte[]> object if successful. + */ + List getByteInvalidNull(); + + /** + * Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getByteInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + Observable> getByteInvalidNullAsync(); + + /** + * Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + Observable>> getByteInvalidNullWithServiceResponseAsync(); + + /** + * Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with the items base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<byte[]> object if successful. + */ + List getBase64Url(); + + /** + * Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with the items base64url encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getBase64UrlAsync(final ServiceCallback> serviceCallback); + + /** + * Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with the items base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + Observable> getBase64UrlAsync(); + + /** + * Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with the items base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + Observable>> getBase64UrlWithServiceResponseAsync(); + + /** + * Get array of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + List getComplexNull(); + + /** + * Get array of complex type null value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get array of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable> getComplexNullAsync(); + + /** + * Get array of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable>> getComplexNullWithServiceResponseAsync(); + + /** + * Get empty array of complex type []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + List getComplexEmpty(); + + /** + * Get empty array of complex type []. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexEmptyAsync(final ServiceCallback> serviceCallback); + + /** + * Get empty array of complex type []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable> getComplexEmptyAsync(); + + /** + * Get empty array of complex type []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable>> getComplexEmptyWithServiceResponseAsync(); + + /** + * Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + List getComplexItemNull(); + + /** + * Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexItemNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable> getComplexItemNullAsync(); + + /** + * Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable>> getComplexItemNullWithServiceResponseAsync(); + + /** + * Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + List getComplexItemEmpty(); + + /** + * Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexItemEmptyAsync(final ServiceCallback> serviceCallback); + + /** + * Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable> getComplexItemEmptyAsync(); + + /** + * Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable>> getComplexItemEmptyWithServiceResponseAsync(); + + /** + * Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + List getComplexValid(); + + /** + * Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable> getComplexValidAsync(); + + /** + * Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + Observable>> getComplexValidWithServiceResponseAsync(); + + /** + * Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param arrayBody the List<Product> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putComplexValid(List arrayBody); + + /** + * Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param arrayBody the List<Product> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putComplexValidAsync(List arrayBody, final ServiceCallback serviceCallback); + + /** + * Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param arrayBody the List<Product> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putComplexValidAsync(List arrayBody); + + /** + * Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param arrayBody the List<Product> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putComplexValidWithServiceResponseAsync(List arrayBody); + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + List> getArrayNull(); + + /** + * Get a null array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayNullAsync(final ServiceCallback>> serviceCallback); + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>> getArrayNullAsync(); + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>>> getArrayNullWithServiceResponseAsync(); + + /** + * Get an empty array []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + List> getArrayEmpty(); + + /** + * Get an empty array []. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayEmptyAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an empty array []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>> getArrayEmptyAsync(); + + /** + * Get an empty array []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>>> getArrayEmptyWithServiceResponseAsync(); + + /** + * Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + List> getArrayItemNull(); + + /** + * Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayItemNullAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>> getArrayItemNullAsync(); + + /** + * Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>>> getArrayItemNullWithServiceResponseAsync(); + + /** + * Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + List> getArrayItemEmpty(); + + /** + * Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayItemEmptyAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>> getArrayItemEmptyAsync(); + + /** + * Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>>> getArrayItemEmptyWithServiceResponseAsync(); + + /** + * Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + List> getArrayValid(); + + /** + * Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayValidAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>> getArrayValidAsync(); + + /** + * Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + Observable>>> getArrayValidWithServiceResponseAsync(); + + /** + * Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param arrayBody the List<List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putArrayValid(List> arrayBody); + + /** + * Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param arrayBody the List<List<String>> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putArrayValidAsync(List> arrayBody, final ServiceCallback serviceCallback); + + /** + * Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param arrayBody the List<List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putArrayValidAsync(List> arrayBody); + + /** + * Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param arrayBody the List<List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putArrayValidWithServiceResponseAsync(List> arrayBody); + + /** + * Get an array of Dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + List> getDictionaryNull(); + + /** + * Get an array of Dictionaries with value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryNullAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of Dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>> getDictionaryNullAsync(); + + /** + * Get an array of Dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>>> getDictionaryNullWithServiceResponseAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + List> getDictionaryEmpty(); + + /** + * Get an array of Dictionaries of type <string, string> with value []. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryEmptyAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of Dictionaries of type <string, string> with value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>> getDictionaryEmptyAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>>> getDictionaryEmptyWithServiceResponseAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + List> getDictionaryItemNull(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryItemNullAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>> getDictionaryItemNullAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>>> getDictionaryItemNullWithServiceResponseAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + List> getDictionaryItemEmpty(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryItemEmptyAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>> getDictionaryItemEmptyAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>>> getDictionaryItemEmptyWithServiceResponseAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + List> getDictionaryValid(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryValidAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>> getDictionaryValidAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + Observable>>> getDictionaryValidWithServiceResponseAsync(); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param arrayBody the List<Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDictionaryValid(List> arrayBody); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param arrayBody the List<Map<String, String>> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDictionaryValidAsync(List> arrayBody, final ServiceCallback serviceCallback); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param arrayBody the List<Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDictionaryValidAsync(List> arrayBody); + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param arrayBody the List<Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDictionaryValidWithServiceResponseAsync(List> arrayBody); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/AutoRestSwaggerBATArrayService.java b/test/vanilla/src/main/java/fixtures/bodyarray/AutoRestSwaggerBATArrayService.java new file mode 100644 index 0000000000..e5279c4267 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/AutoRestSwaggerBATArrayService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyarray; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestSwaggerBATArrayService class. + */ +public interface AutoRestSwaggerBATArrayService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Arrays object to access its operations. + * @return the Arrays object. + */ + Arrays arrays(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/implementation/ArraysImpl.java b/test/vanilla/src/main/java/fixtures/bodyarray/implementation/ArraysImpl.java new file mode 100644 index 0000000000..3a295aeb1c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/implementation/ArraysImpl.java @@ -0,0 +1,4756 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyarray.implementation; + +import retrofit2.Retrofit; +import fixtures.bodyarray.Arrays; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.Base64Url; +import com.microsoft.rest.DateTimeRfc1123; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodyarray.models.ErrorException; +import fixtures.bodyarray.models.Product; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import okhttp3.ResponseBody; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Arrays. + */ +public class ArraysImpl implements Arrays { + /** The Retrofit service to perform REST calls. */ + private ArraysService service; + /** The service client containing this operation class. */ + private AutoRestSwaggerBATArrayServiceImpl client; + + /** + * Initializes an instance of Arrays. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ArraysImpl(Retrofit retrofit, AutoRestSwaggerBATArrayServiceImpl client) { + this.service = retrofit.create(ArraysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Arrays to be + * used by Retrofit to perform actually REST calls. + */ + interface ArraysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getNull" }) + @GET("array/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getInvalid" }) + @GET("array/invalid") + Observable> getInvalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getEmpty" }) + @GET("array/empty") + Observable> getEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putEmpty" }) + @PUT("array/empty") + Observable> putEmpty(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getBooleanTfft" }) + @GET("array/prim/boolean/tfft") + Observable> getBooleanTfft(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putBooleanTfft" }) + @PUT("array/prim/boolean/tfft") + Observable> putBooleanTfft(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getBooleanInvalidNull" }) + @GET("array/prim/boolean/true.null.false") + Observable> getBooleanInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getBooleanInvalidString" }) + @GET("array/prim/boolean/true.boolean.false") + Observable> getBooleanInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getIntegerValid" }) + @GET("array/prim/integer/1.-1.3.300") + Observable> getIntegerValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putIntegerValid" }) + @PUT("array/prim/integer/1.-1.3.300") + Observable> putIntegerValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getIntInvalidNull" }) + @GET("array/prim/integer/1.null.zero") + Observable> getIntInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getIntInvalidString" }) + @GET("array/prim/integer/1.integer.0") + Observable> getIntInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getLongValid" }) + @GET("array/prim/long/1.-1.3.300") + Observable> getLongValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putLongValid" }) + @PUT("array/prim/long/1.-1.3.300") + Observable> putLongValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getLongInvalidNull" }) + @GET("array/prim/long/1.null.zero") + Observable> getLongInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getLongInvalidString" }) + @GET("array/prim/long/1.integer.0") + Observable> getLongInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getFloatValid" }) + @GET("array/prim/float/0--0.01-1.2e20") + Observable> getFloatValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putFloatValid" }) + @PUT("array/prim/float/0--0.01-1.2e20") + Observable> putFloatValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getFloatInvalidNull" }) + @GET("array/prim/float/0.0-null-1.2e20") + Observable> getFloatInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getFloatInvalidString" }) + @GET("array/prim/float/1.number.0") + Observable> getFloatInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDoubleValid" }) + @GET("array/prim/double/0--0.01-1.2e20") + Observable> getDoubleValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putDoubleValid" }) + @PUT("array/prim/double/0--0.01-1.2e20") + Observable> putDoubleValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDoubleInvalidNull" }) + @GET("array/prim/double/0.0-null-1.2e20") + Observable> getDoubleInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDoubleInvalidString" }) + @GET("array/prim/double/1.number.0") + Observable> getDoubleInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getStringValid" }) + @GET("array/prim/string/foo1.foo2.foo3") + Observable> getStringValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putStringValid" }) + @PUT("array/prim/string/foo1.foo2.foo3") + Observable> putStringValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getStringWithNull" }) + @GET("array/prim/string/foo.null.foo2") + Observable> getStringWithNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getStringWithInvalid" }) + @GET("array/prim/string/foo.123.foo2") + Observable> getStringWithInvalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getUuidValid" }) + @GET("array/prim/uuid/valid") + Observable> getUuidValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putUuidValid" }) + @PUT("array/prim/uuid/valid") + Observable> putUuidValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getUuidInvalidChars" }) + @GET("array/prim/uuid/invalidchars") + Observable> getUuidInvalidChars(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDateValid" }) + @GET("array/prim/date/valid") + Observable> getDateValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putDateValid" }) + @PUT("array/prim/date/valid") + Observable> putDateValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDateInvalidNull" }) + @GET("array/prim/date/invalidnull") + Observable> getDateInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDateInvalidChars" }) + @GET("array/prim/date/invalidchars") + Observable> getDateInvalidChars(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDateTimeValid" }) + @GET("array/prim/date-time/valid") + Observable> getDateTimeValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putDateTimeValid" }) + @PUT("array/prim/date-time/valid") + Observable> putDateTimeValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDateTimeInvalidNull" }) + @GET("array/prim/date-time/invalidnull") + Observable> getDateTimeInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDateTimeInvalidChars" }) + @GET("array/prim/date-time/invalidchars") + Observable> getDateTimeInvalidChars(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDateTimeRfc1123Valid" }) + @GET("array/prim/date-time-rfc1123/valid") + Observable> getDateTimeRfc1123Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putDateTimeRfc1123Valid" }) + @PUT("array/prim/date-time-rfc1123/valid") + Observable> putDateTimeRfc1123Valid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDurationValid" }) + @GET("array/prim/duration/valid") + Observable> getDurationValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putDurationValid" }) + @PUT("array/prim/duration/valid") + Observable> putDurationValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getByteValid" }) + @GET("array/prim/byte/valid") + Observable> getByteValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putByteValid" }) + @PUT("array/prim/byte/valid") + Observable> putByteValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getByteInvalidNull" }) + @GET("array/prim/byte/invalidnull") + Observable> getByteInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getBase64Url" }) + @GET("array/prim/base64url/valid") + Observable> getBase64Url(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getComplexNull" }) + @GET("array/complex/null") + Observable> getComplexNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getComplexEmpty" }) + @GET("array/complex/empty") + Observable> getComplexEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getComplexItemNull" }) + @GET("array/complex/itemnull") + Observable> getComplexItemNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getComplexItemEmpty" }) + @GET("array/complex/itemempty") + Observable> getComplexItemEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getComplexValid" }) + @GET("array/complex/valid") + Observable> getComplexValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putComplexValid" }) + @PUT("array/complex/valid") + Observable> putComplexValid(@Body List arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getArrayNull" }) + @GET("array/array/null") + Observable> getArrayNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getArrayEmpty" }) + @GET("array/array/empty") + Observable> getArrayEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getArrayItemNull" }) + @GET("array/array/itemnull") + Observable> getArrayItemNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getArrayItemEmpty" }) + @GET("array/array/itemempty") + Observable> getArrayItemEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getArrayValid" }) + @GET("array/array/valid") + Observable> getArrayValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putArrayValid" }) + @PUT("array/array/valid") + Observable> putArrayValid(@Body List> arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDictionaryNull" }) + @GET("array/dictionary/null") + Observable> getDictionaryNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDictionaryEmpty" }) + @GET("array/dictionary/empty") + Observable> getDictionaryEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDictionaryItemNull" }) + @GET("array/dictionary/itemnull") + Observable> getDictionaryItemNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDictionaryItemEmpty" }) + @GET("array/dictionary/itemempty") + Observable> getDictionaryItemEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays getDictionaryValid" }) + @GET("array/dictionary/valid") + Observable> getDictionaryValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyarray.Arrays putDictionaryValid" }) + @PUT("array/dictionary/valid") + Observable> putDictionaryValid(@Body List> arrayBody); + + } + + /** + * Get null array value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + public List getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null array value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null array value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable> getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get null array value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable>> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid array [1, 2, 3. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + public List getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid array [1, 2, 3. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getInvalidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid array [1, 2, 3. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable> getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get invalid array [1, 2, 3. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable>> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get empty array value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + public List getEmpty() { + return getEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty array value []. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getEmptyAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty array value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable> getEmptyAsync() { + return getEmptyWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get empty array value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable>> getEmptyWithServiceResponseAsync() { + return service.getEmpty() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value empty []. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putEmpty(List arrayBody) { + putEmptyWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value empty []. + * + * @param arrayBody the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putEmptyAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putEmptyWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value empty []. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putEmptyAsync(List arrayBody) { + return putEmptyWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value empty []. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putEmptyWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putEmpty(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean array value [true, false, false, true]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Boolean> object if successful. + */ + public List getBooleanTfft() { + return getBooleanTfftWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean array value [true, false, false, true]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getBooleanTfftAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getBooleanTfftWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean array value [true, false, false, true]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + public Observable> getBooleanTfftAsync() { + return getBooleanTfftWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean array value [true, false, false, true]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + public Observable>> getBooleanTfftWithServiceResponseAsync() { + return service.getBooleanTfft() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getBooleanTfftDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getBooleanTfftDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value empty [true, false, false, true]. + * + * @param arrayBody the List<Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBooleanTfft(List arrayBody) { + putBooleanTfftWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value empty [true, false, false, true]. + * + * @param arrayBody the List<Boolean> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBooleanTfftAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBooleanTfftWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value empty [true, false, false, true]. + * + * @param arrayBody the List<Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBooleanTfftAsync(List arrayBody) { + return putBooleanTfftWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value empty [true, false, false, true]. + * + * @param arrayBody the List<Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBooleanTfftWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putBooleanTfft(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBooleanTfftDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBooleanTfftDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean array value [true, null, false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Boolean> object if successful. + */ + public List getBooleanInvalidNull() { + return getBooleanInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean array value [true, null, false]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getBooleanInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getBooleanInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean array value [true, null, false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + public Observable> getBooleanInvalidNullAsync() { + return getBooleanInvalidNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean array value [true, null, false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + public Observable>> getBooleanInvalidNullWithServiceResponseAsync() { + return service.getBooleanInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getBooleanInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getBooleanInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean array value [true, 'boolean', false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Boolean> object if successful. + */ + public List getBooleanInvalidString() { + return getBooleanInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean array value [true, 'boolean', false]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getBooleanInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getBooleanInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean array value [true, 'boolean', false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + public Observable> getBooleanInvalidStringAsync() { + return getBooleanInvalidStringWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean array value [true, 'boolean', false]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Boolean> object + */ + public Observable>> getBooleanInvalidStringWithServiceResponseAsync() { + return service.getBooleanInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getBooleanInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getBooleanInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + public List getIntegerValid() { + return getIntegerValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getIntegerValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getIntegerValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable> getIntegerValidAsync() { + return getIntegerValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable>> getIntegerValidWithServiceResponseAsync() { + return service.getIntegerValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getIntegerValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getIntegerValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putIntegerValid(List arrayBody) { + putIntegerValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Integer> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putIntegerValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putIntegerValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putIntegerValidAsync(List arrayBody) { + return putIntegerValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putIntegerValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putIntegerValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putIntegerValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putIntegerValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + public List getIntInvalidNull() { + return getIntInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer array value [1, null, 0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getIntInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getIntInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable> getIntInvalidNullAsync() { + return getIntInvalidNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable>> getIntInvalidNullWithServiceResponseAsync() { + return service.getIntInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getIntInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getIntInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Integer> object if successful. + */ + public List getIntInvalidString() { + return getIntInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer array value [1, 'integer', 0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getIntInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getIntInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable> getIntInvalidStringAsync() { + return getIntInvalidStringWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Integer> object + */ + public Observable>> getIntInvalidStringWithServiceResponseAsync() { + return service.getIntInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getIntInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getIntInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Long> object if successful. + */ + public List getLongValid() { + return getLongValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getLongValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getLongValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + public Observable> getLongValidAsync() { + return getLongValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer array value [1, -1, 3, 300]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + public Observable>> getLongValidWithServiceResponseAsync() { + return service.getLongValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getLongValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getLongValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putLongValid(List arrayBody) { + putLongValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Long> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putLongValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putLongValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putLongValidAsync(List arrayBody) { + return putLongValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value empty [1, -1, 3, 300]. + * + * @param arrayBody the List<Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putLongValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putLongValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putLongValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putLongValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get long array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Long> object if successful. + */ + public List getLongInvalidNull() { + return getLongInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get long array value [1, null, 0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getLongInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getLongInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get long array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + public Observable> getLongInvalidNullAsync() { + return getLongInvalidNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get long array value [1, null, 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + public Observable>> getLongInvalidNullWithServiceResponseAsync() { + return service.getLongInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getLongInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getLongInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get long array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Long> object if successful. + */ + public List getLongInvalidString() { + return getLongInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get long array value [1, 'integer', 0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getLongInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getLongInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get long array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + public Observable> getLongInvalidStringAsync() { + return getLongInvalidStringWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get long array value [1, 'integer', 0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Long> object + */ + public Observable>> getLongInvalidStringWithServiceResponseAsync() { + return service.getLongInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getLongInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getLongInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + public List getFloatValid() { + return getFloatValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getFloatValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getFloatValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable> getFloatValidAsync() { + return getFloatValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable>> getFloatValidWithServiceResponseAsync() { + return service.getFloatValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getFloatValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getFloatValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putFloatValid(List arrayBody) { + putFloatValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putFloatValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putFloatValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putFloatValidAsync(List arrayBody) { + return putFloatValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putFloatValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putFloatValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putFloatValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putFloatValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + public List getFloatInvalidNull() { + return getFloatInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getFloatInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getFloatInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable> getFloatInvalidNullAsync() { + return getFloatInvalidNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable>> getFloatInvalidNullWithServiceResponseAsync() { + return service.getFloatInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getFloatInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getFloatInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + public List getFloatInvalidString() { + return getFloatInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getFloatInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getFloatInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable> getFloatInvalidStringAsync() { + return getFloatInvalidStringWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable>> getFloatInvalidStringWithServiceResponseAsync() { + return service.getFloatInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getFloatInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getFloatInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + public List getDoubleValid() { + return getDoubleValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDoubleValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDoubleValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable> getDoubleValidAsync() { + return getDoubleValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get float array value [0, -0.01, 1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable>> getDoubleValidWithServiceResponseAsync() { + return service.getDoubleValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDoubleValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDoubleValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDoubleValid(List arrayBody) { + putDoubleValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDoubleValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDoubleValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDoubleValidAsync(List arrayBody) { + return putDoubleValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value [0, -0.01, 1.2e20]. + * + * @param arrayBody the List<Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDoubleValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDoubleValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDoubleValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDoubleValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + public List getDoubleInvalidNull() { + return getDoubleInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDoubleInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDoubleInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable> getDoubleInvalidNullAsync() { + return getDoubleInvalidNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get float array value [0.0, null, -1.2e20]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable>> getDoubleInvalidNullWithServiceResponseAsync() { + return service.getDoubleInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDoubleInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDoubleInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Double> object if successful. + */ + public List getDoubleInvalidString() { + return getDoubleInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDoubleInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDoubleInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable> getDoubleInvalidStringAsync() { + return getDoubleInvalidStringWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean array value [1.0, 'number', 0.0]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Double> object + */ + public Observable>> getDoubleInvalidStringWithServiceResponseAsync() { + return service.getDoubleInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDoubleInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDoubleInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get string array value ['foo1', 'foo2', 'foo3']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<String> object if successful. + */ + public List getStringValid() { + return getStringValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get string array value ['foo1', 'foo2', 'foo3']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStringValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getStringValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get string array value ['foo1', 'foo2', 'foo3']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable> getStringValidAsync() { + return getStringValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get string array value ['foo1', 'foo2', 'foo3']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable>> getStringValidWithServiceResponseAsync() { + return service.getStringValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getStringValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getStringValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value ['foo1', 'foo2', 'foo3']. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putStringValid(List arrayBody) { + putStringValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value ['foo1', 'foo2', 'foo3']. + * + * @param arrayBody the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putStringValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putStringValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value ['foo1', 'foo2', 'foo3']. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putStringValidAsync(List arrayBody) { + return putStringValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value ['foo1', 'foo2', 'foo3']. + * + * @param arrayBody the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putStringValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putStringValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putStringValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putStringValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get string array value ['foo', null, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<String> object if successful. + */ + public List getStringWithNull() { + return getStringWithNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get string array value ['foo', null, 'foo2']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStringWithNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getStringWithNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get string array value ['foo', null, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable> getStringWithNullAsync() { + return getStringWithNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get string array value ['foo', null, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable>> getStringWithNullWithServiceResponseAsync() { + return service.getStringWithNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getStringWithNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getStringWithNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get string array value ['foo', 123, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<String> object if successful. + */ + public List getStringWithInvalid() { + return getStringWithInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get string array value ['foo', 123, 'foo2']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStringWithInvalidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getStringWithInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get string array value ['foo', 123, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable> getStringWithInvalidAsync() { + return getStringWithInvalidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get string array value ['foo', 123, 'foo2']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable>> getStringWithInvalidWithServiceResponseAsync() { + return service.getStringWithInvalid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getStringWithInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getStringWithInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<UUID> object if successful. + */ + public List getUuidValid() { + return getUuidValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getUuidValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getUuidValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UUID> object + */ + public Observable> getUuidValidAsync() { + return getUuidValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UUID> object + */ + public Observable>> getUuidValidWithServiceResponseAsync() { + return service.getUuidValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getUuidValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getUuidValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param arrayBody the List<UUID> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putUuidValid(List arrayBody) { + putUuidValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param arrayBody the List<UUID> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putUuidValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putUuidValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param arrayBody the List<UUID> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putUuidValidAsync(List arrayBody) { + return putUuidValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'd1399005-30f7-40d6-8da6-dd7c89ad34db', 'f42f6aa1-a5bc-4ddf-907e-5f915de43205']. + * + * @param arrayBody the List<UUID> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putUuidValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putUuidValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putUuidValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putUuidValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<UUID> object if successful. + */ + public List getUuidInvalidChars() { + return getUuidInvalidCharsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getUuidInvalidCharsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getUuidInvalidCharsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UUID> object + */ + public Observable> getUuidInvalidCharsAsync() { + return getUuidInvalidCharsWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get uuid array value ['6dcc7237-45fe-45c4-8a6b-3a8a3f625652', 'foo']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UUID> object + */ + public Observable>> getUuidInvalidCharsWithServiceResponseAsync() { + return service.getUuidInvalidChars() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getUuidInvalidCharsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getUuidInvalidCharsDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<LocalDate> object if successful. + */ + public List getDateValid() { + return getDateValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + public Observable> getDateValidAsync() { + return getDateValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + public Observable>> getDateValidWithServiceResponseAsync() { + return service.getDateValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param arrayBody the List<LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDateValid(List arrayBody) { + putDateValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param arrayBody the List<LocalDate> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param arrayBody the List<LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateValidAsync(List arrayBody) { + return putDateValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value ['2000-12-01', '1980-01-02', '1492-10-12']. + * + * @param arrayBody the List<LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDateValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date array value ['2012-01-01', null, '1776-07-04']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<LocalDate> object if successful. + */ + public List getDateInvalidNull() { + return getDateInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date array value ['2012-01-01', null, '1776-07-04']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date array value ['2012-01-01', null, '1776-07-04']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + public Observable> getDateInvalidNullAsync() { + return getDateInvalidNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date array value ['2012-01-01', null, '1776-07-04']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + public Observable>> getDateInvalidNullWithServiceResponseAsync() { + return service.getDateInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date array value ['2011-03-22', 'date']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<LocalDate> object if successful. + */ + public List getDateInvalidChars() { + return getDateInvalidCharsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date array value ['2011-03-22', 'date']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateInvalidCharsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateInvalidCharsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date array value ['2011-03-22', 'date']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + public Observable> getDateInvalidCharsAsync() { + return getDateInvalidCharsWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date array value ['2011-03-22', 'date']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LocalDate> object + */ + public Observable>> getDateInvalidCharsWithServiceResponseAsync() { + return service.getDateInvalidChars() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateInvalidCharsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateInvalidCharsDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DateTime> object if successful. + */ + public List getDateTimeValid() { + return getDateTimeValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateTimeValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + public Observable> getDateTimeValidAsync() { + return getDateTimeValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date-time array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + public Observable>> getDateTimeValidWithServiceResponseAsync() { + return service.getDateTimeValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateTimeValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateTimeValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param arrayBody the List<DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDateTimeValid(List arrayBody) { + putDateTimeValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param arrayBody the List<DateTime> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateTimeValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateTimeValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param arrayBody the List<DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateTimeValidAsync(List arrayBody) { + return putDateTimeValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value ['2000-12-01t00:00:01z', '1980-01-02T00:11:35+01:00', '1492-10-12T10:15:01-08:00']. + * + * @param arrayBody the List<DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateTimeValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDateTimeValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateTimeValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateTimeValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date array value ['2000-12-01t00:00:01z', null]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DateTime> object if successful. + */ + public List getDateTimeInvalidNull() { + return getDateTimeInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date array value ['2000-12-01t00:00:01z', null]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateTimeInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date array value ['2000-12-01t00:00:01z', null]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + public Observable> getDateTimeInvalidNullAsync() { + return getDateTimeInvalidNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date array value ['2000-12-01t00:00:01z', null]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + public Observable>> getDateTimeInvalidNullWithServiceResponseAsync() { + return service.getDateTimeInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateTimeInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateTimeInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date array value ['2000-12-01t00:00:01z', 'date-time']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DateTime> object if successful. + */ + public List getDateTimeInvalidChars() { + return getDateTimeInvalidCharsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date array value ['2000-12-01t00:00:01z', 'date-time']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateTimeInvalidCharsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeInvalidCharsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date array value ['2000-12-01t00:00:01z', 'date-time']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + public Observable> getDateTimeInvalidCharsAsync() { + return getDateTimeInvalidCharsWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date array value ['2000-12-01t00:00:01z', 'date-time']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + public Observable>> getDateTimeInvalidCharsWithServiceResponseAsync() { + return service.getDateTimeInvalidChars() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateTimeInvalidCharsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateTimeInvalidCharsDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<DateTime> object if successful. + */ + public List getDateTimeRfc1123Valid() { + return getDateTimeRfc1123ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateTimeRfc1123ValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeRfc1123ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + public Observable> getDateTimeRfc1123ValidAsync() { + return getDateTimeRfc1123ValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date-time array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DateTime> object + */ + public Observable>> getDateTimeRfc1123ValidWithServiceResponseAsync() { + return service.getDateTimeRfc1123Valid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDateTimeRfc1123ValidDelegate(response); + List body = null; + if (result.body() != null) { + body = new ArrayList(); + for (DateTimeRfc1123 item : result.body()) { + DateTime value; + value = item.dateTime(); + body.add(value); + } + } + ServiceResponse> clientResponse = new ServiceResponse>(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateTimeRfc1123ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param arrayBody the List<DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDateTimeRfc1123Valid(List arrayBody) { + putDateTimeRfc1123ValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param arrayBody the List<DateTimeRfc1123> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateTimeRfc1123ValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateTimeRfc1123ValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param arrayBody the List<DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateTimeRfc1123ValidAsync(List arrayBody) { + return putDateTimeRfc1123ValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value ['Fri, 01 Dec 2000 00:00:01 GMT', 'Wed, 02 Jan 1980 00:11:35 GMT', 'Wed, 12 Oct 1492 10:15:01 GMT']. + * + * @param arrayBody the List<DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateTimeRfc1123ValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + List arrayBodyConverted = new ArrayList(); + for (DateTime item : arrayBody) { + DateTimeRfc1123 value = new DateTimeRfc1123(item); + arrayBodyConverted.add(value); + } + return service.putDateTimeRfc1123Valid(arrayBodyConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateTimeRfc1123ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateTimeRfc1123ValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Period> object if successful. + */ + public List getDurationValid() { + return getDurationValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDurationValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDurationValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Period> object + */ + public Observable> getDurationValidAsync() { + return getDurationValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get duration array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Period> object + */ + public Observable>> getDurationValidWithServiceResponseAsync() { + return service.getDurationValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDurationValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDurationValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param arrayBody the List<Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDurationValid(List arrayBody) { + putDurationValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param arrayBody the List<Period> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDurationValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDurationValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param arrayBody the List<Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDurationValidAsync(List arrayBody) { + return putDurationValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set array value ['P123DT22H14M12.011S', 'P5DT1H0M0S']. + * + * @param arrayBody the List<Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDurationValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDurationValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDurationValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDurationValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<byte[]> object if successful. + */ + public List getByteValid() { + return getByteValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getByteValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getByteValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + public Observable> getByteValidAsync() { + return getByteValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get byte array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + public Observable>> getByteValidWithServiceResponseAsync() { + return service.getByteValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getByteValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getByteValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each elementencoded in base 64. + * + * @param arrayBody the List<byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putByteValid(List arrayBody) { + putByteValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each elementencoded in base 64. + * + * @param arrayBody the List<byte[]> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putByteValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putByteValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each elementencoded in base 64. + * + * @param arrayBody the List<byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putByteValidAsync(List arrayBody) { + return putByteValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put the array value [hex(FF FF FF FA), hex(01 02 03), hex (25, 29, 43)] with each elementencoded in base 64. + * + * @param arrayBody the List<byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putByteValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putByteValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putByteValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putByteValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<byte[]> object if successful. + */ + public List getByteInvalidNull() { + return getByteInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getByteInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getByteInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + public Observable> getByteInvalidNullAsync() { + return getByteInvalidNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get byte array value [hex(AB, AC, AD), null] with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + public Observable>> getByteInvalidNullWithServiceResponseAsync() { + return service.getByteInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getByteInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getByteInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with the items base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<byte[]> object if successful. + */ + public List getBase64Url() { + return getBase64UrlWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with the items base64url encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getBase64UrlAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getBase64UrlWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with the items base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + public Observable> getBase64UrlAsync() { + return getBase64UrlWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get array value ['a string that gets encoded with base64url', 'test string' 'Lorem ipsum'] with the items base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<byte[]> object + */ + public Observable>> getBase64UrlWithServiceResponseAsync() { + return service.getBase64Url() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getBase64UrlDelegate(response); + List body = null; + if (result.body() != null) { + body = new ArrayList(); + for (Base64Url item : result.body()) { + byte[] value; + value = item.decodedBytes(); + body.add(value); + } + } + ServiceResponse> clientResponse = new ServiceResponse>(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getBase64UrlDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get array of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + public List getComplexNull() { + return getComplexNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get array of complex type null value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get array of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable> getComplexNullAsync() { + return getComplexNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get array of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable>> getComplexNullWithServiceResponseAsync() { + return service.getComplexNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get empty array of complex type []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + public List getComplexEmpty() { + return getComplexEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty array of complex type []. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexEmptyAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty array of complex type []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable> getComplexEmptyAsync() { + return getComplexEmptyWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get empty array of complex type []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable>> getComplexEmptyWithServiceResponseAsync() { + return service.getComplexEmpty() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + public List getComplexItemNull() { + return getComplexItemNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexItemNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexItemNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable> getComplexItemNullAsync() { + return getComplexItemNullWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get array of complex type with null item [{'integer': 1 'string': '2'}, null, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable>> getComplexItemNullWithServiceResponseAsync() { + return service.getComplexItemNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexItemNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexItemNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + public List getComplexItemEmpty() { + return getComplexItemEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexItemEmptyAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexItemEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable> getComplexItemEmptyAsync() { + return getComplexItemEmptyWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get array of complex type with empty item [{'integer': 1 'string': '2'}, {}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable>> getComplexItemEmptyWithServiceResponseAsync() { + return service.getComplexItemEmpty() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexItemEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexItemEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Product> object if successful. + */ + public List getComplexValid() { + return getComplexValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable> getComplexValidAsync() { + return getComplexValidWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get array of complex type with [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Product> object + */ + public Observable>> getComplexValidWithServiceResponseAsync() { + return service.getComplexValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param arrayBody the List<Product> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putComplexValid(List arrayBody) { + putComplexValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param arrayBody the List<Product> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putComplexValidAsync(List arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putComplexValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param arrayBody the List<Product> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putComplexValidAsync(List arrayBody) { + return putComplexValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put an array of complex type with values [{'integer': 1 'string': '2'}, {'integer': 3, 'string': '4'}, {'integer': 5, 'string': '6'}]. + * + * @param arrayBody the List<Product> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putComplexValidWithServiceResponseAsync(List arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putComplexValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putComplexValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putComplexValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + public List> getArrayNull() { + return getArrayNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a null array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayNullAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>> getArrayNullAsync() { + return getArrayNullWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>>> getArrayNullWithServiceResponseAsync() { + return service.getArrayNull() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an empty array []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + public List> getArrayEmpty() { + return getArrayEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an empty array []. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayEmptyAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an empty array []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>> getArrayEmptyAsync() { + return getArrayEmptyWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an empty array []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>>> getArrayEmptyWithServiceResponseAsync() { + return service.getArrayEmpty() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + public List> getArrayItemNull() { + return getArrayItemNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayItemNullAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayItemNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>> getArrayItemNullAsync() { + return getArrayItemNullWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of array of strings [['1', '2', '3'], null, ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>>> getArrayItemNullWithServiceResponseAsync() { + return service.getArrayItemNull() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayItemNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayItemNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + public List> getArrayItemEmpty() { + return getArrayItemEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayItemEmptyAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayItemEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>> getArrayItemEmptyAsync() { + return getArrayItemEmptyWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of array of strings [['1', '2', '3'], [], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>>> getArrayItemEmptyWithServiceResponseAsync() { + return service.getArrayItemEmpty() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayItemEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayItemEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<List<String>> object if successful. + */ + public List> getArrayValid() { + return getArrayValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayValidAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>> getArrayValidAsync() { + return getArrayValidWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<List<String>> object + */ + public Observable>>> getArrayValidWithServiceResponseAsync() { + return service.getArrayValid() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param arrayBody the List<List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putArrayValid(List> arrayBody) { + putArrayValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param arrayBody the List<List<String>> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putArrayValidAsync(List> arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putArrayValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param arrayBody the List<List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putArrayValidAsync(List> arrayBody) { + return putArrayValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put An array of array of strings [['1', '2', '3'], ['4', '5', '6'], ['7', '8', '9']]. + * + * @param arrayBody the List<List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putArrayValidWithServiceResponseAsync(List> arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putArrayValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putArrayValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putArrayValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of Dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + public List> getDictionaryNull() { + return getDictionaryNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of Dictionaries with value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryNullAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of Dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>> getDictionaryNullAsync() { + return getDictionaryNullWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of Dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>>> getDictionaryNullWithServiceResponseAsync() { + return service.getDictionaryNull() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of Dictionaries of type <string, string> with value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + public List> getDictionaryEmpty() { + return getDictionaryEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of Dictionaries of type <string, string> with value []. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryEmptyAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of Dictionaries of type <string, string> with value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>> getDictionaryEmptyAsync() { + return getDictionaryEmptyWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of Dictionaries of type <string, string> with value []. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>>> getDictionaryEmptyWithServiceResponseAsync() { + return service.getDictionaryEmpty() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + public List> getDictionaryItemNull() { + return getDictionaryItemNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryItemNullAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryItemNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>> getDictionaryItemNullAsync() { + return getDictionaryItemNullWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, null, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>>> getDictionaryItemNullWithServiceResponseAsync() { + return service.getDictionaryItemNull() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryItemNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryItemNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + public List> getDictionaryItemEmpty() { + return getDictionaryItemEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryItemEmptyAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryItemEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>> getDictionaryItemEmptyAsync() { + return getDictionaryItemEmptyWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>>> getDictionaryItemEmptyWithServiceResponseAsync() { + return service.getDictionaryItemEmpty() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryItemEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryItemEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<Map<String, String>> object if successful. + */ + public List> getDictionaryValid() { + return getDictionaryValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryValidAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>> getDictionaryValidAsync() { + return getDictionaryValidWithServiceResponseAsync().map(new Func1>>, List>>() { + @Override + public List> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<Map<String, String>> object + */ + public Observable>>> getDictionaryValidWithServiceResponseAsync() { + return service.getDictionaryValid() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param arrayBody the List<Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDictionaryValid(List> arrayBody) { + putDictionaryValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param arrayBody the List<Map<String, String>> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDictionaryValidAsync(List> arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDictionaryValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param arrayBody the List<Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDictionaryValidAsync(List> arrayBody) { + return putDictionaryValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of Dictionaries of type <string, string> with value [{'1': 'one', '2': 'two', '3': 'three'}, {'4': 'four', '5': 'five', '6': 'six'}, {'7': 'seven', '8': 'eight', '9': 'nine'}]. + * + * @param arrayBody the List<Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDictionaryValidWithServiceResponseAsync(List> arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDictionaryValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDictionaryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDictionaryValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/implementation/AutoRestSwaggerBATArrayServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodyarray/implementation/AutoRestSwaggerBATArrayServiceImpl.java new file mode 100644 index 0000000000..6d243625b5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/implementation/AutoRestSwaggerBATArrayServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyarray.implementation; + +import fixtures.bodyarray.AutoRestSwaggerBATArrayService; +import fixtures.bodyarray.Arrays; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestSwaggerBATArrayService class. + */ +public class AutoRestSwaggerBATArrayServiceImpl extends ServiceClient implements AutoRestSwaggerBATArrayService { + + /** + * The Arrays object to access its operations. + */ + private Arrays arrays; + + /** + * Gets the Arrays object to access its operations. + * @return the Arrays object. + */ + public Arrays arrays() { + return this.arrays; + } + + /** + * Initializes an instance of AutoRestSwaggerBATArrayService client. + */ + public AutoRestSwaggerBATArrayServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestSwaggerBATArrayService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestSwaggerBATArrayServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATArrayService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATArrayServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATArrayService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATArrayServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATArrayService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestSwaggerBATArrayServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.arrays = new ArraysImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodyarray/implementation/package-info.java new file mode 100644 index 0000000000..e34efad38e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestSwaggerBATArrayService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyarray.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/models/Error.java b/test/vanilla/src/main/java/fixtures/bodyarray/models/Error.java new file mode 100644 index 0000000000..fbc92936a9 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyarray.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodyarray/models/ErrorException.java new file mode 100644 index 0000000000..a8cdf984ea --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyarray.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/models/Product.java b/test/vanilla/src/main/java/fixtures/bodyarray/models/Product.java new file mode 100644 index 0000000000..98693c9b5c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/models/Product.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyarray.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Product model. + */ +public class Product { + /** + * The integer property. + */ + @JsonProperty(value = "integer") + private Integer integer; + + /** + * The stringProperty property. + */ + @JsonProperty(value = "string") + private String stringProperty; + + /** + * Get the integer value. + * + * @return the integer value + */ + public Integer integer() { + return this.integer; + } + + /** + * Set the integer value. + * + * @param integer the integer value to set + * @return the Product object itself. + */ + public Product withInteger(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get the stringProperty value. + * + * @return the stringProperty value + */ + public String stringProperty() { + return this.stringProperty; + } + + /** + * Set the stringProperty value. + * + * @param stringProperty the stringProperty value to set + * @return the Product object itself. + */ + public Product withStringProperty(String stringProperty) { + this.stringProperty = stringProperty; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodyarray/models/package-info.java new file mode 100644 index 0000000000..90bf75b838 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestSwaggerBATArrayService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyarray.models; diff --git a/test/vanilla/src/main/java/fixtures/bodyarray/package-info.java b/test/vanilla/src/main/java/fixtures/bodyarray/package-info.java new file mode 100644 index 0000000000..a31a20d306 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyarray/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestSwaggerBATArrayService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyarray; diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/AutoRestBoolTestService.java b/test/vanilla/src/main/java/fixtures/bodyboolean/AutoRestBoolTestService.java new file mode 100644 index 0000000000..7a5d011d2d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/AutoRestBoolTestService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyboolean; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestBoolTestService class. + */ +public interface AutoRestBoolTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Bools object to access its operations. + * @return the Bools object. + */ + Bools bools(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/Bools.java b/test/vanilla/src/main/java/fixtures/bodyboolean/Bools.java new file mode 100644 index 0000000000..d3ddd0ed27 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/Bools.java @@ -0,0 +1,241 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyboolean; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyboolean.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Bools. + */ +public interface Bools { + /** + * Get true Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean getTrue(); + + /** + * Get true Boolean value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getTrueAsync(final ServiceCallback serviceCallback); + + /** + * Get true Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable getTrueAsync(); + + /** + * Get true Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> getTrueWithServiceResponseAsync(); + + /** + * Set Boolean value true. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putTrue(boolean boolBody); + + /** + * Set Boolean value true. + * + * @param boolBody the boolean value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putTrueAsync(boolean boolBody, final ServiceCallback serviceCallback); + + /** + * Set Boolean value true. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putTrueAsync(boolean boolBody); + + /** + * Set Boolean value true. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putTrueWithServiceResponseAsync(boolean boolBody); + + /** + * Get false Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean getFalse(); + + /** + * Get false Boolean value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getFalseAsync(final ServiceCallback serviceCallback); + + /** + * Get false Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable getFalseAsync(); + + /** + * Get false Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> getFalseWithServiceResponseAsync(); + + /** + * Set Boolean value false. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putFalse(boolean boolBody); + + /** + * Set Boolean value false. + * + * @param boolBody the boolean value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putFalseAsync(boolean boolBody, final ServiceCallback serviceCallback); + + /** + * Set Boolean value false. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putFalseAsync(boolean boolBody); + + /** + * Set Boolean value false. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putFalseWithServiceResponseAsync(boolean boolBody); + + /** + * Get null Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean getNull(); + + /** + * Get null Boolean value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable getNullAsync(); + + /** + * Get null Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get invalid Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean getInvalid(); + + /** + * Get invalid Boolean value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable getInvalidAsync(); + + /** + * Get invalid Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> getInvalidWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/AutoRestBoolTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/AutoRestBoolTestServiceImpl.java new file mode 100644 index 0000000000..ed97ee05cf --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/AutoRestBoolTestServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyboolean.implementation; + +import fixtures.bodyboolean.AutoRestBoolTestService; +import fixtures.bodyboolean.Bools; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestBoolTestService class. + */ +public class AutoRestBoolTestServiceImpl extends ServiceClient implements AutoRestBoolTestService { + + /** + * The Bools object to access its operations. + */ + private Bools bools; + + /** + * Gets the Bools object to access its operations. + * @return the Bools object. + */ + public Bools bools() { + return this.bools; + } + + /** + * Initializes an instance of AutoRestBoolTestService client. + */ + public AutoRestBoolTestServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestBoolTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestBoolTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestBoolTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestBoolTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestBoolTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestBoolTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestBoolTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestBoolTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.bools = new BoolsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/BoolsImpl.java b/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/BoolsImpl.java new file mode 100644 index 0000000000..20b8f7ef72 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/BoolsImpl.java @@ -0,0 +1,484 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyboolean.implementation; + +import retrofit2.Retrofit; +import fixtures.bodyboolean.Bools; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyboolean.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Bools. + */ +public class BoolsImpl implements Bools { + /** The Retrofit service to perform REST calls. */ + private BoolsService service; + /** The service client containing this operation class. */ + private AutoRestBoolTestServiceImpl client; + + /** + * Initializes an instance of Bools. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BoolsImpl(Retrofit retrofit, AutoRestBoolTestServiceImpl client) { + this.service = retrofit.create(BoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Bools to be + * used by Retrofit to perform actually REST calls. + */ + interface BoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyboolean.Bools getTrue" }) + @GET("bool/true") + Observable> getTrue(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyboolean.Bools putTrue" }) + @PUT("bool/true") + Observable> putTrue(@Body boolean boolBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyboolean.Bools getFalse" }) + @GET("bool/false") + Observable> getFalse(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyboolean.Bools putFalse" }) + @PUT("bool/false") + Observable> putFalse(@Body boolean boolBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyboolean.Bools getNull" }) + @GET("bool/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyboolean.Bools getInvalid" }) + @GET("bool/invalid") + Observable> getInvalid(); + + } + + /** + * Get true Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean getTrue() { + return getTrueWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get true Boolean value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTrueAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTrueWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get true Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable getTrueAsync() { + return getTrueWithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get true Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> getTrueWithServiceResponseAsync() { + return service.getTrue() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTrueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTrueDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set Boolean value true. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putTrue(boolean boolBody) { + putTrueWithServiceResponseAsync(boolBody).toBlocking().single().body(); + } + + /** + * Set Boolean value true. + * + * @param boolBody the boolean value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putTrueAsync(boolean boolBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putTrueWithServiceResponseAsync(boolBody), serviceCallback); + } + + /** + * Set Boolean value true. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putTrueAsync(boolean boolBody) { + return putTrueWithServiceResponseAsync(boolBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set Boolean value true. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putTrueWithServiceResponseAsync(boolean boolBody) { + return service.putTrue(boolBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putTrueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putTrueDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get false Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean getFalse() { + return getFalseWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get false Boolean value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFalseAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFalseWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get false Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable getFalseAsync() { + return getFalseWithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get false Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> getFalseWithServiceResponseAsync() { + return service.getFalse() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getFalseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getFalseDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set Boolean value false. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putFalse(boolean boolBody) { + putFalseWithServiceResponseAsync(boolBody).toBlocking().single().body(); + } + + /** + * Set Boolean value false. + * + * @param boolBody the boolean value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putFalseAsync(boolean boolBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putFalseWithServiceResponseAsync(boolBody), serviceCallback); + } + + /** + * Set Boolean value false. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putFalseAsync(boolean boolBody) { + return putFalseWithServiceResponseAsync(boolBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set Boolean value false. + * + * @param boolBody the boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putFalseWithServiceResponseAsync(boolean boolBody) { + return service.putFalse(boolBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putFalseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putFalseDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null Boolean value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid Boolean value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid Boolean value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/package-info.java new file mode 100644 index 0000000000..8ff6929e77 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestBoolTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyboolean.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/models/Error.java b/test/vanilla/src/main/java/fixtures/bodyboolean/models/Error.java new file mode 100644 index 0000000000..acd2e3d767 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyboolean.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodyboolean/models/ErrorException.java new file mode 100644 index 0000000000..2b2b36391d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyboolean.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodyboolean/models/package-info.java new file mode 100644 index 0000000000..dd217d840e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestBoolTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyboolean.models; diff --git a/test/vanilla/src/main/java/fixtures/bodyboolean/package-info.java b/test/vanilla/src/main/java/fixtures/bodyboolean/package-info.java new file mode 100644 index 0000000000..5b9634e004 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyboolean/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestBoolTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyboolean; diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/AutoRestSwaggerBATByteService.java b/test/vanilla/src/main/java/fixtures/bodybyte/AutoRestSwaggerBATByteService.java new file mode 100644 index 0000000000..22b2da140e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/AutoRestSwaggerBATByteService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodybyte; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestSwaggerBATByteService class. + */ +public interface AutoRestSwaggerBATByteService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Bytes object to access its operations. + * @return the Bytes object. + */ + Bytes bytes(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/Bytes.java b/test/vanilla/src/main/java/fixtures/bodybyte/Bytes.java new file mode 100644 index 0000000000..2fae45a5c0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/Bytes.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodybyte; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodybyte.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Bytes. + */ +public interface Bytes { + /** + * Get null byte value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + byte[] getNull(); + + /** + * Get null byte value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null byte value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable getNullAsync(); + + /** + * Get null byte value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get empty byte value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + byte[] getEmpty(); + + /** + * Get empty byte value ''. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get empty byte value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable getEmptyAsync(); + + /** + * Get empty byte value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable> getEmptyWithServiceResponseAsync(); + + /** + * Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + byte[] getNonAscii(); + + /** + * Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNonAsciiAsync(final ServiceCallback serviceCallback); + + /** + * Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable getNonAsciiAsync(); + + /** + * Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable> getNonAsciiWithServiceResponseAsync(); + + /** + * Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param byteBody Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putNonAscii(byte[] byteBody); + + /** + * Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param byteBody Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNonAsciiAsync(byte[] byteBody, final ServiceCallback serviceCallback); + + /** + * Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param byteBody Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putNonAsciiAsync(byte[] byteBody); + + /** + * Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param byteBody Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putNonAsciiWithServiceResponseAsync(byte[] byteBody); + + /** + * Get invalid byte value ':::SWAGGER::::'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + byte[] getInvalid(); + + /** + * Get invalid byte value ':::SWAGGER::::'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid byte value ':::SWAGGER::::'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable getInvalidAsync(); + + /** + * Get invalid byte value ':::SWAGGER::::'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable> getInvalidWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/implementation/AutoRestSwaggerBATByteServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodybyte/implementation/AutoRestSwaggerBATByteServiceImpl.java new file mode 100644 index 0000000000..ea06d6a5e8 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/implementation/AutoRestSwaggerBATByteServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodybyte.implementation; + +import fixtures.bodybyte.AutoRestSwaggerBATByteService; +import fixtures.bodybyte.Bytes; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestSwaggerBATByteService class. + */ +public class AutoRestSwaggerBATByteServiceImpl extends ServiceClient implements AutoRestSwaggerBATByteService { + + /** + * The Bytes object to access its operations. + */ + private Bytes bytes; + + /** + * Gets the Bytes object to access its operations. + * @return the Bytes object. + */ + public Bytes bytes() { + return this.bytes; + } + + /** + * Initializes an instance of AutoRestSwaggerBATByteService client. + */ + public AutoRestSwaggerBATByteServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestSwaggerBATByteService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestSwaggerBATByteServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATByteService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATByteServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATByteService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATByteServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATByteService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestSwaggerBATByteServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.bytes = new BytesImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/implementation/BytesImpl.java b/test/vanilla/src/main/java/fixtures/bodybyte/implementation/BytesImpl.java new file mode 100644 index 0000000000..0f61d61954 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/implementation/BytesImpl.java @@ -0,0 +1,414 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodybyte.implementation; + +import retrofit2.Retrofit; +import fixtures.bodybyte.Bytes; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodybyte.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Bytes. + */ +public class BytesImpl implements Bytes { + /** The Retrofit service to perform REST calls. */ + private BytesService service; + /** The service client containing this operation class. */ + private AutoRestSwaggerBATByteServiceImpl client; + + /** + * Initializes an instance of Bytes. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BytesImpl(Retrofit retrofit, AutoRestSwaggerBATByteServiceImpl client) { + this.service = retrofit.create(BytesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Bytes to be + * used by Retrofit to perform actually REST calls. + */ + interface BytesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodybyte.Bytes getNull" }) + @GET("byte/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodybyte.Bytes getEmpty" }) + @GET("byte/empty") + Observable> getEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodybyte.Bytes getNonAscii" }) + @GET("byte/nonAscii") + Observable> getNonAscii(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodybyte.Bytes putNonAscii" }) + @PUT("byte/nonAscii") + Observable> putNonAscii(@Body byte[] byteBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodybyte.Bytes getInvalid" }) + @GET("byte/invalid") + Observable> getInvalid(); + + } + + /** + * Get null byte value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + public byte[] getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null byte value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null byte value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, byte[]>() { + @Override + public byte[] call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null byte value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get empty byte value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + public byte[] getEmpty() { + return getEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty byte value ''. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty byte value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable getEmptyAsync() { + return getEmptyWithServiceResponseAsync().map(new Func1, byte[]>() { + @Override + public byte[] call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get empty byte value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable> getEmptyWithServiceResponseAsync() { + return service.getEmpty() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + public byte[] getNonAscii() { + return getNonAsciiWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNonAsciiAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNonAsciiWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable getNonAsciiAsync() { + return getNonAsciiWithServiceResponseAsync().map(new Func1, byte[]>() { + @Override + public byte[] call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable> getNonAsciiWithServiceResponseAsync() { + return service.getNonAscii() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNonAsciiDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNonAsciiDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param byteBody Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putNonAscii(byte[] byteBody) { + putNonAsciiWithServiceResponseAsync(byteBody).toBlocking().single().body(); + } + + /** + * Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param byteBody Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNonAsciiAsync(byte[] byteBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNonAsciiWithServiceResponseAsync(byteBody), serviceCallback); + } + + /** + * Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param byteBody Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putNonAsciiAsync(byte[] byteBody) { + return putNonAsciiWithServiceResponseAsync(byteBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6). + * + * @param byteBody Base64-encoded non-ascii byte string hex(FF FE FD FC FB FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putNonAsciiWithServiceResponseAsync(byte[] byteBody) { + if (byteBody == null) { + throw new IllegalArgumentException("Parameter byteBody is required and cannot be null."); + } + return service.putNonAscii(byteBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putNonAsciiDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putNonAsciiDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid byte value ':::SWAGGER::::'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + public byte[] getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid byte value ':::SWAGGER::::'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid byte value ':::SWAGGER::::'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1, byte[]>() { + @Override + public byte[] call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid byte value ':::SWAGGER::::'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodybyte/implementation/package-info.java new file mode 100644 index 0000000000..81438a2fe3 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestSwaggerBATByteService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodybyte.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/models/Error.java b/test/vanilla/src/main/java/fixtures/bodybyte/models/Error.java new file mode 100644 index 0000000000..62ac9d8eff --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodybyte.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodybyte/models/ErrorException.java new file mode 100644 index 0000000000..c0b9fbddc3 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodybyte.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodybyte/models/package-info.java new file mode 100644 index 0000000000..0fbd131704 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestSwaggerBATByteService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodybyte.models; diff --git a/test/vanilla/src/main/java/fixtures/bodybyte/package-info.java b/test/vanilla/src/main/java/fixtures/bodybyte/package-info.java new file mode 100644 index 0000000000..ad4a9e46e9 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodybyte/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestSwaggerBATByteService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodybyte; diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/Arrays.java b/test/vanilla/src/main/java/fixtures/bodycomplex/Arrays.java new file mode 100644 index 0000000000..ee2642d705 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/Arrays.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodycomplex.models.ArrayWrapper; +import fixtures.bodycomplex.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Arrays. + */ +public interface Arrays { + /** + * Get complex types with array property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArrayWrapper object if successful. + */ + ArrayWrapper getValid(); + + /** + * Get complex types with array property. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getValidAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with array property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + Observable getValidAsync(); + + /** + * Get complex types with array property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + Observable> getValidWithServiceResponseAsync(); + + /** + * Put complex types with array property. + * + * @param complexBody Please put an array with 4 items: "1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putValid(ArrayWrapper complexBody); + + /** + * Put complex types with array property. + * + * @param complexBody Please put an array with 4 items: "1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putValidAsync(ArrayWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with array property. + * + * @param complexBody Please put an array with 4 items: "1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putValidAsync(ArrayWrapper complexBody); + + /** + * Put complex types with array property. + * + * @param complexBody Please put an array with 4 items: "1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putValidWithServiceResponseAsync(ArrayWrapper complexBody); + + /** + * Get complex types with array property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArrayWrapper object if successful. + */ + ArrayWrapper getEmpty(); + + /** + * Get complex types with array property which is empty. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with array property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + Observable getEmptyAsync(); + + /** + * Get complex types with array property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + Observable> getEmptyWithServiceResponseAsync(); + + /** + * Put complex types with array property which is empty. + * + * @param complexBody Please put an empty array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putEmpty(ArrayWrapper complexBody); + + /** + * Put complex types with array property which is empty. + * + * @param complexBody Please put an empty array + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putEmptyAsync(ArrayWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with array property which is empty. + * + * @param complexBody Please put an empty array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putEmptyAsync(ArrayWrapper complexBody); + + /** + * Put complex types with array property which is empty. + * + * @param complexBody Please put an empty array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putEmptyWithServiceResponseAsync(ArrayWrapper complexBody); + + /** + * Get complex types with array property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArrayWrapper object if successful. + */ + ArrayWrapper getNotProvided(); + + /** + * Get complex types with array property while server doesn't provide a response payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNotProvidedAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with array property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + Observable getNotProvidedAsync(); + + /** + * Get complex types with array property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + Observable> getNotProvidedWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/AutoRestComplexTestService.java b/test/vanilla/src/main/java/fixtures/bodycomplex/AutoRestComplexTestService.java new file mode 100644 index 0000000000..1eee27aa22 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/AutoRestComplexTestService.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestComplexTestService class. + */ +public interface AutoRestComplexTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets API ID.. + * + * @return the apiVersion value. + */ + String apiVersion(); + + /** + * Sets API ID.. + * + * @param apiVersion the apiVersion value. + * @return the service client itself + */ + AutoRestComplexTestService withApiVersion(String apiVersion); + + /** + * Gets the Basics object to access its operations. + * @return the Basics object. + */ + Basics basics(); + + /** + * Gets the Primitives object to access its operations. + * @return the Primitives object. + */ + Primitives primitives(); + + /** + * Gets the Arrays object to access its operations. + * @return the Arrays object. + */ + Arrays arrays(); + + /** + * Gets the Dictionarys object to access its operations. + * @return the Dictionarys object. + */ + Dictionarys dictionarys(); + + /** + * Gets the Inheritances object to access its operations. + * @return the Inheritances object. + */ + Inheritances inheritances(); + + /** + * Gets the Polymorphisms object to access its operations. + * @return the Polymorphisms object. + */ + Polymorphisms polymorphisms(); + + /** + * Gets the Polymorphicrecursives object to access its operations. + * @return the Polymorphicrecursives object. + */ + Polymorphicrecursives polymorphicrecursives(); + + /** + * Gets the Readonlypropertys object to access its operations. + * @return the Readonlypropertys object. + */ + Readonlypropertys readonlypropertys(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/Basics.java b/test/vanilla/src/main/java/fixtures/bodycomplex/Basics.java new file mode 100644 index 0000000000..cbc491c6ed --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/Basics.java @@ -0,0 +1,239 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodycomplex.models.Basic; +import fixtures.bodycomplex.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Basics. + */ +public interface Basics { + /** + * Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + Basic getValid(); + + /** + * Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getValidAsync(final ServiceCallback serviceCallback); + + /** + * Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable getValidAsync(); + + /** + * Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable> getValidWithServiceResponseAsync(); + + /** + * Please put {id: 2, name: 'abc', color: 'Magenta'}. + * + * @param complexBody Please put {id: 2, name: 'abc', color: 'Magenta'} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putValid(Basic complexBody); + + /** + * Please put {id: 2, name: 'abc', color: 'Magenta'}. + * + * @param complexBody Please put {id: 2, name: 'abc', color: 'Magenta'} + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putValidAsync(Basic complexBody, final ServiceCallback serviceCallback); + + /** + * Please put {id: 2, name: 'abc', color: 'Magenta'}. + * + * @param complexBody Please put {id: 2, name: 'abc', color: 'Magenta'} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putValidAsync(Basic complexBody); + + /** + * Please put {id: 2, name: 'abc', color: 'Magenta'}. + * + * @param complexBody Please put {id: 2, name: 'abc', color: 'Magenta'} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putValidWithServiceResponseAsync(Basic complexBody); + + /** + * Get a basic complex type that is invalid for the local strong type. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + Basic getInvalid(); + + /** + * Get a basic complex type that is invalid for the local strong type. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback); + + /** + * Get a basic complex type that is invalid for the local strong type. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable getInvalidAsync(); + + /** + * Get a basic complex type that is invalid for the local strong type. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable> getInvalidWithServiceResponseAsync(); + + /** + * Get a basic complex type that is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + Basic getEmpty(); + + /** + * Get a basic complex type that is empty. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get a basic complex type that is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable getEmptyAsync(); + + /** + * Get a basic complex type that is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable> getEmptyWithServiceResponseAsync(); + + /** + * Get a basic complex type whose properties are null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + Basic getNull(); + + /** + * Get a basic complex type whose properties are null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get a basic complex type whose properties are null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable getNullAsync(); + + /** + * Get a basic complex type whose properties are null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get a basic complex type while the server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + Basic getNotProvided(); + + /** + * Get a basic complex type while the server doesn't provide a response payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNotProvidedAsync(final ServiceCallback serviceCallback); + + /** + * Get a basic complex type while the server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable getNotProvidedAsync(); + + /** + * Get a basic complex type while the server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + Observable> getNotProvidedWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/Dictionarys.java b/test/vanilla/src/main/java/fixtures/bodycomplex/Dictionarys.java new file mode 100644 index 0000000000..4865d9fead --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/Dictionarys.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodycomplex.models.DictionaryWrapper; +import fixtures.bodycomplex.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Dictionarys. + */ +public interface Dictionarys { + /** + * Get complex types with dictionary property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DictionaryWrapper object if successful. + */ + DictionaryWrapper getValid(); + + /** + * Get complex types with dictionary property. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getValidAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with dictionary property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + Observable getValidAsync(); + + /** + * Get complex types with dictionary property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + Observable> getValidWithServiceResponseAsync(); + + /** + * Put complex types with dictionary property. + * + * @param complexBody Please put a dictionary with 5 key-value pairs: "txt":"notepad", "bmp":"mspaint", "xls":"excel", "exe":"", "":null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putValid(DictionaryWrapper complexBody); + + /** + * Put complex types with dictionary property. + * + * @param complexBody Please put a dictionary with 5 key-value pairs: "txt":"notepad", "bmp":"mspaint", "xls":"excel", "exe":"", "":null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putValidAsync(DictionaryWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with dictionary property. + * + * @param complexBody Please put a dictionary with 5 key-value pairs: "txt":"notepad", "bmp":"mspaint", "xls":"excel", "exe":"", "":null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putValidAsync(DictionaryWrapper complexBody); + + /** + * Put complex types with dictionary property. + * + * @param complexBody Please put a dictionary with 5 key-value pairs: "txt":"notepad", "bmp":"mspaint", "xls":"excel", "exe":"", "":null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putValidWithServiceResponseAsync(DictionaryWrapper complexBody); + + /** + * Get complex types with dictionary property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DictionaryWrapper object if successful. + */ + DictionaryWrapper getEmpty(); + + /** + * Get complex types with dictionary property which is empty. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with dictionary property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + Observable getEmptyAsync(); + + /** + * Get complex types with dictionary property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + Observable> getEmptyWithServiceResponseAsync(); + + /** + * Put complex types with dictionary property which is empty. + * + * @param complexBody Please put an empty dictionary + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putEmpty(DictionaryWrapper complexBody); + + /** + * Put complex types with dictionary property which is empty. + * + * @param complexBody Please put an empty dictionary + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putEmptyAsync(DictionaryWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with dictionary property which is empty. + * + * @param complexBody Please put an empty dictionary + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putEmptyAsync(DictionaryWrapper complexBody); + + /** + * Put complex types with dictionary property which is empty. + * + * @param complexBody Please put an empty dictionary + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putEmptyWithServiceResponseAsync(DictionaryWrapper complexBody); + + /** + * Get complex types with dictionary property which is null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DictionaryWrapper object if successful. + */ + DictionaryWrapper getNull(); + + /** + * Get complex types with dictionary property which is null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with dictionary property which is null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + Observable getNullAsync(); + + /** + * Get complex types with dictionary property which is null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get complex types with dictionary property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DictionaryWrapper object if successful. + */ + DictionaryWrapper getNotProvided(); + + /** + * Get complex types with dictionary property while server doesn't provide a response payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNotProvidedAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with dictionary property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + Observable getNotProvidedAsync(); + + /** + * Get complex types with dictionary property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + Observable> getNotProvidedWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/Inheritances.java b/test/vanilla/src/main/java/fixtures/bodycomplex/Inheritances.java new file mode 100644 index 0000000000..13a4416afa --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/Inheritances.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.Siamese; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Inheritances. + */ +public interface Inheritances { + /** + * Get complex types that extend others. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Siamese object if successful. + */ + Siamese getValid(); + + /** + * Get complex types that extend others. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getValidAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types that extend others. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Siamese object + */ + Observable getValidAsync(); + + /** + * Get complex types that extend others. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Siamese object + */ + Observable> getValidWithServiceResponseAsync(); + + /** + * Put complex types that extend others. + * + * @param complexBody Please put a siamese with id=2, name="Siameee", color=green, breed=persion, which hates 2 dogs, the 1st one named "Potato" with id=1 and food="tomato", and the 2nd one named "Tomato" with id=-1 and food="french fries". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putValid(Siamese complexBody); + + /** + * Put complex types that extend others. + * + * @param complexBody Please put a siamese with id=2, name="Siameee", color=green, breed=persion, which hates 2 dogs, the 1st one named "Potato" with id=1 and food="tomato", and the 2nd one named "Tomato" with id=-1 and food="french fries". + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putValidAsync(Siamese complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types that extend others. + * + * @param complexBody Please put a siamese with id=2, name="Siameee", color=green, breed=persion, which hates 2 dogs, the 1st one named "Potato" with id=1 and food="tomato", and the 2nd one named "Tomato" with id=-1 and food="french fries". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putValidAsync(Siamese complexBody); + + /** + * Put complex types that extend others. + * + * @param complexBody Please put a siamese with id=2, name="Siameee", color=green, breed=persion, which hates 2 dogs, the 1st one named "Potato" with id=1 and food="tomato", and the 2nd one named "Tomato" with id=-1 and food="french fries". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putValidWithServiceResponseAsync(Siamese complexBody); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/Polymorphicrecursives.java b/test/vanilla/src/main/java/fixtures/bodycomplex/Polymorphicrecursives.java new file mode 100644 index 0000000000..7b74086d48 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/Polymorphicrecursives.java @@ -0,0 +1,307 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.Fish; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Polymorphicrecursives. + */ +public interface Polymorphicrecursives { + /** + * Get complex types that are polymorphic and have recursive references. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Fish object if successful. + */ + Fish getValid(); + + /** + * Get complex types that are polymorphic and have recursive references. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getValidAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types that are polymorphic and have recursive references. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Fish object + */ + Observable getValidAsync(); + + /** + * Get complex types that are polymorphic and have recursive references. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Fish object + */ + Observable> getValidWithServiceResponseAsync(); + + /** + * Put complex types that are polymorphic and have recursive references. + * + * @param complexBody Please put a salmon that looks like this: + { + "fishtype": "salmon", + "species": "king", + "length": 1, + "age": 1, + "location": "alaska", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6, + "siblings": [ + { + "fishtype": "salmon", + "species": "coho", + "length": 2, + "age": 2, + "location": "atlantic", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putValid(Fish complexBody); + + /** + * Put complex types that are polymorphic and have recursive references. + * + * @param complexBody Please put a salmon that looks like this: + { + "fishtype": "salmon", + "species": "king", + "length": 1, + "age": 1, + "location": "alaska", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6, + "siblings": [ + { + "fishtype": "salmon", + "species": "coho", + "length": 2, + "age": 2, + "location": "atlantic", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + } + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putValidAsync(Fish complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types that are polymorphic and have recursive references. + * + * @param complexBody Please put a salmon that looks like this: + { + "fishtype": "salmon", + "species": "king", + "length": 1, + "age": 1, + "location": "alaska", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6, + "siblings": [ + { + "fishtype": "salmon", + "species": "coho", + "length": 2, + "age": 2, + "location": "atlantic", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putValidAsync(Fish complexBody); + + /** + * Put complex types that are polymorphic and have recursive references. + * + * @param complexBody Please put a salmon that looks like this: + { + "fishtype": "salmon", + "species": "king", + "length": 1, + "age": 1, + "location": "alaska", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6, + "siblings": [ + { + "fishtype": "salmon", + "species": "coho", + "length": 2, + "age": 2, + "location": "atlantic", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putValidWithServiceResponseAsync(Fish complexBody); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/Polymorphisms.java b/test/vanilla/src/main/java/fixtures/bodycomplex/Polymorphisms.java new file mode 100644 index 0000000000..1ebfd6db3d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/Polymorphisms.java @@ -0,0 +1,365 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.Fish; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Polymorphisms. + */ +public interface Polymorphisms { + /** + * Get complex types that are polymorphic. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Fish object if successful. + */ + Fish getValid(); + + /** + * Get complex types that are polymorphic. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getValidAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types that are polymorphic. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Fish object + */ + Observable getValidAsync(); + + /** + * Get complex types that are polymorphic. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Fish object + */ + Observable> getValidWithServiceResponseAsync(); + + /** + * Put complex types that are polymorphic. + * + * @param complexBody Please put a salmon that looks like this: + { + 'fishtype':'Salmon', + 'location':'alaska', + 'iswild':true, + 'species':'king', + 'length':1.0, + 'siblings':[ + { + 'fishtype':'Shark', + 'age':6, + 'birthday': '2012-01-05T01:00:00Z', + 'length':20.0, + 'species':'predator', + }, + { + 'fishtype':'Sawshark', + 'age':105, + 'birthday': '1900-01-05T01:00:00Z', + 'length':10.0, + 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), + 'species':'dangerous', + }, + { + 'fishtype': 'goblin', + 'age': 1, + 'birthday': '2015-08-08T00:00:00Z', + 'length': 30.0, + 'species': 'scary', + 'jawsize': 5 + } + ] + }; + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putValid(Fish complexBody); + + /** + * Put complex types that are polymorphic. + * + * @param complexBody Please put a salmon that looks like this: + { + 'fishtype':'Salmon', + 'location':'alaska', + 'iswild':true, + 'species':'king', + 'length':1.0, + 'siblings':[ + { + 'fishtype':'Shark', + 'age':6, + 'birthday': '2012-01-05T01:00:00Z', + 'length':20.0, + 'species':'predator', + }, + { + 'fishtype':'Sawshark', + 'age':105, + 'birthday': '1900-01-05T01:00:00Z', + 'length':10.0, + 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), + 'species':'dangerous', + }, + { + 'fishtype': 'goblin', + 'age': 1, + 'birthday': '2015-08-08T00:00:00Z', + 'length': 30.0, + 'species': 'scary', + 'jawsize': 5 + } + ] + }; + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putValidAsync(Fish complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types that are polymorphic. + * + * @param complexBody Please put a salmon that looks like this: + { + 'fishtype':'Salmon', + 'location':'alaska', + 'iswild':true, + 'species':'king', + 'length':1.0, + 'siblings':[ + { + 'fishtype':'Shark', + 'age':6, + 'birthday': '2012-01-05T01:00:00Z', + 'length':20.0, + 'species':'predator', + }, + { + 'fishtype':'Sawshark', + 'age':105, + 'birthday': '1900-01-05T01:00:00Z', + 'length':10.0, + 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), + 'species':'dangerous', + }, + { + 'fishtype': 'goblin', + 'age': 1, + 'birthday': '2015-08-08T00:00:00Z', + 'length': 30.0, + 'species': 'scary', + 'jawsize': 5 + } + ] + }; + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putValidAsync(Fish complexBody); + + /** + * Put complex types that are polymorphic. + * + * @param complexBody Please put a salmon that looks like this: + { + 'fishtype':'Salmon', + 'location':'alaska', + 'iswild':true, + 'species':'king', + 'length':1.0, + 'siblings':[ + { + 'fishtype':'Shark', + 'age':6, + 'birthday': '2012-01-05T01:00:00Z', + 'length':20.0, + 'species':'predator', + }, + { + 'fishtype':'Sawshark', + 'age':105, + 'birthday': '1900-01-05T01:00:00Z', + 'length':10.0, + 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), + 'species':'dangerous', + }, + { + 'fishtype': 'goblin', + 'age': 1, + 'birthday': '2015-08-08T00:00:00Z', + 'length': 30.0, + 'species': 'scary', + 'jawsize': 5 + } + ] + }; + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putValidWithServiceResponseAsync(Fish complexBody); + + /** + * Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client. + * + * @param complexBody Please attempt put a sawshark that looks like this, the client should not allow this data to be sent: + { + "fishtype": "sawshark", + "species": "snaggle toothed", + "length": 18.5, + "age": 2, + "birthday": "2013-06-01T01:00:00Z", + "location": "alaska", + "picture": base64(FF FF FF FF FE), + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "birthday": "2012-01-05T01:00:00Z", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "picture": base64(FF FF FF FF FE), + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putValidMissingRequired(Fish complexBody); + + /** + * Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client. + * + * @param complexBody Please attempt put a sawshark that looks like this, the client should not allow this data to be sent: + { + "fishtype": "sawshark", + "species": "snaggle toothed", + "length": 18.5, + "age": 2, + "birthday": "2013-06-01T01:00:00Z", + "location": "alaska", + "picture": base64(FF FF FF FF FE), + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "birthday": "2012-01-05T01:00:00Z", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "picture": base64(FF FF FF FF FE), + "length": 10, + "age": 105 + } + ] + } + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putValidMissingRequiredAsync(Fish complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client. + * + * @param complexBody Please attempt put a sawshark that looks like this, the client should not allow this data to be sent: + { + "fishtype": "sawshark", + "species": "snaggle toothed", + "length": 18.5, + "age": 2, + "birthday": "2013-06-01T01:00:00Z", + "location": "alaska", + "picture": base64(FF FF FF FF FE), + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "birthday": "2012-01-05T01:00:00Z", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "picture": base64(FF FF FF FF FE), + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putValidMissingRequiredAsync(Fish complexBody); + + /** + * Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client. + * + * @param complexBody Please attempt put a sawshark that looks like this, the client should not allow this data to be sent: + { + "fishtype": "sawshark", + "species": "snaggle toothed", + "length": 18.5, + "age": 2, + "birthday": "2013-06-01T01:00:00Z", + "location": "alaska", + "picture": base64(FF FF FF FF FE), + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "birthday": "2012-01-05T01:00:00Z", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "picture": base64(FF FF FF FF FE), + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putValidMissingRequiredWithServiceResponseAsync(Fish complexBody); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/Primitives.java b/test/vanilla/src/main/java/fixtures/bodycomplex/Primitives.java new file mode 100644 index 0000000000..db194caee1 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/Primitives.java @@ -0,0 +1,839 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodycomplex.models.BooleanWrapper; +import fixtures.bodycomplex.models.ByteWrapper; +import fixtures.bodycomplex.models.Datetimerfc1123Wrapper; +import fixtures.bodycomplex.models.DatetimeWrapper; +import fixtures.bodycomplex.models.DateWrapper; +import fixtures.bodycomplex.models.DoubleWrapper; +import fixtures.bodycomplex.models.DurationWrapper; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.FloatWrapper; +import fixtures.bodycomplex.models.IntWrapper; +import fixtures.bodycomplex.models.LongWrapper; +import fixtures.bodycomplex.models.StringWrapper; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Primitives. + */ +public interface Primitives { + /** + * Get complex types with integer properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IntWrapper object if successful. + */ + IntWrapper getInt(); + + /** + * Get complex types with integer properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIntAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with integer properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntWrapper object + */ + Observable getIntAsync(); + + /** + * Get complex types with integer properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntWrapper object + */ + Observable> getIntWithServiceResponseAsync(); + + /** + * Put complex types with integer properties. + * + * @param complexBody Please put -1 and 2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putInt(IntWrapper complexBody); + + /** + * Put complex types with integer properties. + * + * @param complexBody Please put -1 and 2 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putIntAsync(IntWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with integer properties. + * + * @param complexBody Please put -1 and 2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putIntAsync(IntWrapper complexBody); + + /** + * Put complex types with integer properties. + * + * @param complexBody Please put -1 and 2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putIntWithServiceResponseAsync(IntWrapper complexBody); + + /** + * Get complex types with long properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LongWrapper object if successful. + */ + LongWrapper getLong(); + + /** + * Get complex types with long properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLongAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with long properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LongWrapper object + */ + Observable getLongAsync(); + + /** + * Get complex types with long properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LongWrapper object + */ + Observable> getLongWithServiceResponseAsync(); + + /** + * Put complex types with long properties. + * + * @param complexBody Please put 1099511627775 and -999511627788 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putLong(LongWrapper complexBody); + + /** + * Put complex types with long properties. + * + * @param complexBody Please put 1099511627775 and -999511627788 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putLongAsync(LongWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with long properties. + * + * @param complexBody Please put 1099511627775 and -999511627788 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putLongAsync(LongWrapper complexBody); + + /** + * Put complex types with long properties. + * + * @param complexBody Please put 1099511627775 and -999511627788 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putLongWithServiceResponseAsync(LongWrapper complexBody); + + /** + * Get complex types with float properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FloatWrapper object if successful. + */ + FloatWrapper getFloat(); + + /** + * Get complex types with float properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getFloatAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with float properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FloatWrapper object + */ + Observable getFloatAsync(); + + /** + * Get complex types with float properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FloatWrapper object + */ + Observable> getFloatWithServiceResponseAsync(); + + /** + * Put complex types with float properties. + * + * @param complexBody Please put 1.05 and -0.003 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putFloat(FloatWrapper complexBody); + + /** + * Put complex types with float properties. + * + * @param complexBody Please put 1.05 and -0.003 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putFloatAsync(FloatWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with float properties. + * + * @param complexBody Please put 1.05 and -0.003 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putFloatAsync(FloatWrapper complexBody); + + /** + * Put complex types with float properties. + * + * @param complexBody Please put 1.05 and -0.003 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putFloatWithServiceResponseAsync(FloatWrapper complexBody); + + /** + * Get complex types with double properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DoubleWrapper object if successful. + */ + DoubleWrapper getDouble(); + + /** + * Get complex types with double properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDoubleAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with double properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DoubleWrapper object + */ + Observable getDoubleAsync(); + + /** + * Get complex types with double properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DoubleWrapper object + */ + Observable> getDoubleWithServiceResponseAsync(); + + /** + * Put complex types with double properties. + * + * @param complexBody Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDouble(DoubleWrapper complexBody); + + /** + * Put complex types with double properties. + * + * @param complexBody Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDoubleAsync(DoubleWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with double properties. + * + * @param complexBody Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDoubleAsync(DoubleWrapper complexBody); + + /** + * Put complex types with double properties. + * + * @param complexBody Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDoubleWithServiceResponseAsync(DoubleWrapper complexBody); + + /** + * Get complex types with bool properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BooleanWrapper object if successful. + */ + BooleanWrapper getBool(); + + /** + * Get complex types with bool properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBoolAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with bool properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BooleanWrapper object + */ + Observable getBoolAsync(); + + /** + * Get complex types with bool properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BooleanWrapper object + */ + Observable> getBoolWithServiceResponseAsync(); + + /** + * Put complex types with bool properties. + * + * @param complexBody Please put true and false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBool(BooleanWrapper complexBody); + + /** + * Put complex types with bool properties. + * + * @param complexBody Please put true and false + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBoolAsync(BooleanWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with bool properties. + * + * @param complexBody Please put true and false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBoolAsync(BooleanWrapper complexBody); + + /** + * Put complex types with bool properties. + * + * @param complexBody Please put true and false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBoolWithServiceResponseAsync(BooleanWrapper complexBody); + + /** + * Get complex types with string properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StringWrapper object if successful. + */ + StringWrapper getString(); + + /** + * Get complex types with string properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getStringAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with string properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StringWrapper object + */ + Observable getStringAsync(); + + /** + * Get complex types with string properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StringWrapper object + */ + Observable> getStringWithServiceResponseAsync(); + + /** + * Put complex types with string properties. + * + * @param complexBody Please put 'goodrequest', '', and null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putString(StringWrapper complexBody); + + /** + * Put complex types with string properties. + * + * @param complexBody Please put 'goodrequest', '', and null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putStringAsync(StringWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with string properties. + * + * @param complexBody Please put 'goodrequest', '', and null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putStringAsync(StringWrapper complexBody); + + /** + * Put complex types with string properties. + * + * @param complexBody Please put 'goodrequest', '', and null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putStringWithServiceResponseAsync(StringWrapper complexBody); + + /** + * Get complex types with date properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateWrapper object if successful. + */ + DateWrapper getDate(); + + /** + * Get complex types with date properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDateAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with date properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateWrapper object + */ + Observable getDateAsync(); + + /** + * Get complex types with date properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateWrapper object + */ + Observable> getDateWithServiceResponseAsync(); + + /** + * Put complex types with date properties. + * + * @param complexBody Please put '0001-01-01' and '2016-02-29' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDate(DateWrapper complexBody); + + /** + * Put complex types with date properties. + * + * @param complexBody Please put '0001-01-01' and '2016-02-29' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateAsync(DateWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with date properties. + * + * @param complexBody Please put '0001-01-01' and '2016-02-29' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateAsync(DateWrapper complexBody); + + /** + * Put complex types with date properties. + * + * @param complexBody Please put '0001-01-01' and '2016-02-29' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateWithServiceResponseAsync(DateWrapper complexBody); + + /** + * Get complex types with datetime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatetimeWrapper object if successful. + */ + DatetimeWrapper getDateTime(); + + /** + * Get complex types with datetime properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with datetime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatetimeWrapper object + */ + Observable getDateTimeAsync(); + + /** + * Get complex types with datetime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatetimeWrapper object + */ + Observable> getDateTimeWithServiceResponseAsync(); + + /** + * Put complex types with datetime properties. + * + * @param complexBody Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDateTime(DatetimeWrapper complexBody); + + /** + * Put complex types with datetime properties. + * + * @param complexBody Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateTimeAsync(DatetimeWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with datetime properties. + * + * @param complexBody Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateTimeAsync(DatetimeWrapper complexBody); + + /** + * Put complex types with datetime properties. + * + * @param complexBody Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateTimeWithServiceResponseAsync(DatetimeWrapper complexBody); + + /** + * Get complex types with datetimeRfc1123 properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Datetimerfc1123Wrapper object if successful. + */ + Datetimerfc1123Wrapper getDateTimeRfc1123(); + + /** + * Get complex types with datetimeRfc1123 properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDateTimeRfc1123Async(final ServiceCallback serviceCallback); + + /** + * Get complex types with datetimeRfc1123 properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Datetimerfc1123Wrapper object + */ + Observable getDateTimeRfc1123Async(); + + /** + * Get complex types with datetimeRfc1123 properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Datetimerfc1123Wrapper object + */ + Observable> getDateTimeRfc1123WithServiceResponseAsync(); + + /** + * Put complex types with datetimeRfc1123 properties. + * + * @param complexBody Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDateTimeRfc1123(Datetimerfc1123Wrapper complexBody); + + /** + * Put complex types with datetimeRfc1123 properties. + * + * @param complexBody Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateTimeRfc1123Async(Datetimerfc1123Wrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with datetimeRfc1123 properties. + * + * @param complexBody Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateTimeRfc1123Async(Datetimerfc1123Wrapper complexBody); + + /** + * Put complex types with datetimeRfc1123 properties. + * + * @param complexBody Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateTimeRfc1123WithServiceResponseAsync(Datetimerfc1123Wrapper complexBody); + + /** + * Get complex types with duration properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DurationWrapper object if successful. + */ + DurationWrapper getDuration(); + + /** + * Get complex types with duration properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDurationAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with duration properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DurationWrapper object + */ + Observable getDurationAsync(); + + /** + * Get complex types with duration properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DurationWrapper object + */ + Observable> getDurationWithServiceResponseAsync(); + + /** + * Put complex types with duration properties. + * + * @param complexBody Please put 'P123DT22H14M12.011S' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDuration(DurationWrapper complexBody); + + /** + * Put complex types with duration properties. + * + * @param complexBody Please put 'P123DT22H14M12.011S' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDurationAsync(DurationWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with duration properties. + * + * @param complexBody Please put 'P123DT22H14M12.011S' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDurationAsync(DurationWrapper complexBody); + + /** + * Put complex types with duration properties. + * + * @param complexBody Please put 'P123DT22H14M12.011S' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDurationWithServiceResponseAsync(DurationWrapper complexBody); + + /** + * Get complex types with byte properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ByteWrapper object if successful. + */ + ByteWrapper getByte(); + + /** + * Get complex types with byte properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getByteAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types with byte properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ByteWrapper object + */ + Observable getByteAsync(); + + /** + * Get complex types with byte properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ByteWrapper object + */ + Observable> getByteWithServiceResponseAsync(); + + /** + * Put complex types with byte properties. + * + * @param complexBody Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putByte(ByteWrapper complexBody); + + /** + * Put complex types with byte properties. + * + * @param complexBody Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putByteAsync(ByteWrapper complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types with byte properties. + * + * @param complexBody Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putByteAsync(ByteWrapper complexBody); + + /** + * Put complex types with byte properties. + * + * @param complexBody Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putByteWithServiceResponseAsync(ByteWrapper complexBody); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/Readonlypropertys.java b/test/vanilla/src/main/java/fixtures/bodycomplex/Readonlypropertys.java new file mode 100644 index 0000000000..a10c10ccff --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/Readonlypropertys.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.ReadonlyObj; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Readonlypropertys. + */ +public interface Readonlypropertys { + /** + * Get complex types that have readonly properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReadonlyObj object if successful. + */ + ReadonlyObj getValid(); + + /** + * Get complex types that have readonly properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getValidAsync(final ServiceCallback serviceCallback); + + /** + * Get complex types that have readonly properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReadonlyObj object + */ + Observable getValidAsync(); + + /** + * Get complex types that have readonly properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReadonlyObj object + */ + Observable> getValidWithServiceResponseAsync(); + + /** + * Put complex types that have readonly properties. + * + * @param complexBody the ReadonlyObj value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putValid(ReadonlyObj complexBody); + + /** + * Put complex types that have readonly properties. + * + * @param complexBody the ReadonlyObj value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putValidAsync(ReadonlyObj complexBody, final ServiceCallback serviceCallback); + + /** + * Put complex types that have readonly properties. + * + * @param complexBody the ReadonlyObj value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putValidAsync(ReadonlyObj complexBody); + + /** + * Put complex types that have readonly properties. + * + * @param complexBody the ReadonlyObj value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putValidWithServiceResponseAsync(ReadonlyObj complexBody); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/ArraysImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/ArraysImpl.java new file mode 100644 index 0000000000..b7fdcb28c5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/ArraysImpl.java @@ -0,0 +1,424 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import retrofit2.Retrofit; +import fixtures.bodycomplex.Arrays; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodycomplex.models.ArrayWrapper; +import fixtures.bodycomplex.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Arrays. + */ +public class ArraysImpl implements Arrays { + /** The Retrofit service to perform REST calls. */ + private ArraysService service; + /** The service client containing this operation class. */ + private AutoRestComplexTestServiceImpl client; + + /** + * Initializes an instance of Arrays. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ArraysImpl(Retrofit retrofit, AutoRestComplexTestServiceImpl client) { + this.service = retrofit.create(ArraysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Arrays to be + * used by Retrofit to perform actually REST calls. + */ + interface ArraysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Arrays getValid" }) + @GET("complex/array/valid") + Observable> getValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Arrays putValid" }) + @PUT("complex/array/valid") + Observable> putValid(@Body ArrayWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Arrays getEmpty" }) + @GET("complex/array/empty") + Observable> getEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Arrays putEmpty" }) + @PUT("complex/array/empty") + Observable> putEmpty(@Body ArrayWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Arrays getNotProvided" }) + @GET("complex/array/notprovided") + Observable> getNotProvided(); + + } + + /** + * Get complex types with array property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArrayWrapper object if successful. + */ + public ArrayWrapper getValid() { + return getValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with array property. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with array property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + public Observable getValidAsync() { + return getValidWithServiceResponseAsync().map(new Func1, ArrayWrapper>() { + @Override + public ArrayWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with array property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + public Observable> getValidWithServiceResponseAsync() { + return service.getValid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with array property. + * + * @param complexBody Please put an array with 4 items: "1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putValid(ArrayWrapper complexBody) { + putValidWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with array property. + * + * @param complexBody Please put an array with 4 items: "1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putValidAsync(ArrayWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putValidWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with array property. + * + * @param complexBody Please put an array with 4 items: "1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putValidAsync(ArrayWrapper complexBody) { + return putValidWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with array property. + * + * @param complexBody Please put an array with 4 items: "1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putValidWithServiceResponseAsync(ArrayWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putValid(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with array property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArrayWrapper object if successful. + */ + public ArrayWrapper getEmpty() { + return getEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with array property which is empty. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with array property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + public Observable getEmptyAsync() { + return getEmptyWithServiceResponseAsync().map(new Func1, ArrayWrapper>() { + @Override + public ArrayWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with array property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + public Observable> getEmptyWithServiceResponseAsync() { + return service.getEmpty() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with array property which is empty. + * + * @param complexBody Please put an empty array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putEmpty(ArrayWrapper complexBody) { + putEmptyWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with array property which is empty. + * + * @param complexBody Please put an empty array + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putEmptyAsync(ArrayWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putEmptyWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with array property which is empty. + * + * @param complexBody Please put an empty array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putEmptyAsync(ArrayWrapper complexBody) { + return putEmptyWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with array property which is empty. + * + * @param complexBody Please put an empty array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putEmptyWithServiceResponseAsync(ArrayWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putEmpty(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with array property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ArrayWrapper object if successful. + */ + public ArrayWrapper getNotProvided() { + return getNotProvidedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with array property while server doesn't provide a response payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNotProvidedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNotProvidedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with array property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + public Observable getNotProvidedAsync() { + return getNotProvidedWithServiceResponseAsync().map(new Func1, ArrayWrapper>() { + @Override + public ArrayWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with array property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ArrayWrapper object + */ + public Observable> getNotProvidedWithServiceResponseAsync() { + return service.getNotProvided() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNotProvidedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNotProvidedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/AutoRestComplexTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/AutoRestComplexTestServiceImpl.java new file mode 100644 index 0000000000..3c66b00ac4 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/AutoRestComplexTestServiceImpl.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import fixtures.bodycomplex.AutoRestComplexTestService; +import fixtures.bodycomplex.Basics; +import fixtures.bodycomplex.Primitives; +import fixtures.bodycomplex.Arrays; +import fixtures.bodycomplex.Dictionarys; +import fixtures.bodycomplex.Inheritances; +import fixtures.bodycomplex.Polymorphisms; +import fixtures.bodycomplex.Polymorphicrecursives; +import fixtures.bodycomplex.Readonlypropertys; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestComplexTestService class. + */ +public class AutoRestComplexTestServiceImpl extends ServiceClient implements AutoRestComplexTestService { + + /** API ID. */ + private String apiVersion; + + /** + * Gets API ID. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Sets API ID. + * + * @param apiVersion the apiVersion value. + * @return the service client itself + */ + public AutoRestComplexTestServiceImpl withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * The Basics object to access its operations. + */ + private Basics basics; + + /** + * Gets the Basics object to access its operations. + * @return the Basics object. + */ + public Basics basics() { + return this.basics; + } + + /** + * The Primitives object to access its operations. + */ + private Primitives primitives; + + /** + * Gets the Primitives object to access its operations. + * @return the Primitives object. + */ + public Primitives primitives() { + return this.primitives; + } + + /** + * The Arrays object to access its operations. + */ + private Arrays arrays; + + /** + * Gets the Arrays object to access its operations. + * @return the Arrays object. + */ + public Arrays arrays() { + return this.arrays; + } + + /** + * The Dictionarys object to access its operations. + */ + private Dictionarys dictionarys; + + /** + * Gets the Dictionarys object to access its operations. + * @return the Dictionarys object. + */ + public Dictionarys dictionarys() { + return this.dictionarys; + } + + /** + * The Inheritances object to access its operations. + */ + private Inheritances inheritances; + + /** + * Gets the Inheritances object to access its operations. + * @return the Inheritances object. + */ + public Inheritances inheritances() { + return this.inheritances; + } + + /** + * The Polymorphisms object to access its operations. + */ + private Polymorphisms polymorphisms; + + /** + * Gets the Polymorphisms object to access its operations. + * @return the Polymorphisms object. + */ + public Polymorphisms polymorphisms() { + return this.polymorphisms; + } + + /** + * The Polymorphicrecursives object to access its operations. + */ + private Polymorphicrecursives polymorphicrecursives; + + /** + * Gets the Polymorphicrecursives object to access its operations. + * @return the Polymorphicrecursives object. + */ + public Polymorphicrecursives polymorphicrecursives() { + return this.polymorphicrecursives; + } + + /** + * The Readonlypropertys object to access its operations. + */ + private Readonlypropertys readonlypropertys; + + /** + * Gets the Readonlypropertys object to access its operations. + * @return the Readonlypropertys object. + */ + public Readonlypropertys readonlypropertys() { + return this.readonlypropertys; + } + + /** + * Initializes an instance of AutoRestComplexTestService client. + */ + public AutoRestComplexTestServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestComplexTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestComplexTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestComplexTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestComplexTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestComplexTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestComplexTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestComplexTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestComplexTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.apiVersion = "2014-04-01-preview"; + this.basics = new BasicsImpl(retrofit(), this); + this.primitives = new PrimitivesImpl(retrofit(), this); + this.arrays = new ArraysImpl(retrofit(), this); + this.dictionarys = new DictionarysImpl(retrofit(), this); + this.inheritances = new InheritancesImpl(retrofit(), this); + this.polymorphisms = new PolymorphismsImpl(retrofit(), this); + this.polymorphicrecursives = new PolymorphicrecursivesImpl(retrofit(), this); + this.readonlypropertys = new ReadonlypropertysImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/BasicsImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/BasicsImpl.java new file mode 100644 index 0000000000..3cb789decc --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/BasicsImpl.java @@ -0,0 +1,488 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import retrofit2.Retrofit; +import fixtures.bodycomplex.Basics; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodycomplex.models.Basic; +import fixtures.bodycomplex.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Basics. + */ +public class BasicsImpl implements Basics { + /** The Retrofit service to perform REST calls. */ + private BasicsService service; + /** The service client containing this operation class. */ + private AutoRestComplexTestServiceImpl client; + + /** + * Initializes an instance of Basics. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BasicsImpl(Retrofit retrofit, AutoRestComplexTestServiceImpl client) { + this.service = retrofit.create(BasicsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Basics to be + * used by Retrofit to perform actually REST calls. + */ + interface BasicsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Basics getValid" }) + @GET("complex/basic/valid") + Observable> getValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Basics putValid" }) + @PUT("complex/basic/valid") + Observable> putValid(@Body Basic complexBody, @Query("api-version") String apiVersion); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Basics getInvalid" }) + @GET("complex/basic/invalid") + Observable> getInvalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Basics getEmpty" }) + @GET("complex/basic/empty") + Observable> getEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Basics getNull" }) + @GET("complex/basic/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Basics getNotProvided" }) + @GET("complex/basic/notprovided") + Observable> getNotProvided(); + + } + + /** + * Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + public Basic getValid() { + return getValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable getValidAsync() { + return getValidWithServiceResponseAsync().map(new Func1, Basic>() { + @Override + public Basic call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex type {id: 2, name: 'abc', color: 'YELLOW'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable> getValidWithServiceResponseAsync() { + return service.getValid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Please put {id: 2, name: 'abc', color: 'Magenta'}. + * + * @param complexBody Please put {id: 2, name: 'abc', color: 'Magenta'} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putValid(Basic complexBody) { + putValidWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Please put {id: 2, name: 'abc', color: 'Magenta'}. + * + * @param complexBody Please put {id: 2, name: 'abc', color: 'Magenta'} + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putValidAsync(Basic complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putValidWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Please put {id: 2, name: 'abc', color: 'Magenta'}. + * + * @param complexBody Please put {id: 2, name: 'abc', color: 'Magenta'} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putValidAsync(Basic complexBody) { + return putValidWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Please put {id: 2, name: 'abc', color: 'Magenta'}. + * + * @param complexBody Please put {id: 2, name: 'abc', color: 'Magenta'} + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putValidWithServiceResponseAsync(Basic complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putValid(complexBody, this.client.apiVersion()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a basic complex type that is invalid for the local strong type. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + public Basic getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a basic complex type that is invalid for the local strong type. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a basic complex type that is invalid for the local strong type. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1, Basic>() { + @Override + public Basic call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a basic complex type that is invalid for the local strong type. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a basic complex type that is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + public Basic getEmpty() { + return getEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a basic complex type that is empty. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a basic complex type that is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable getEmptyAsync() { + return getEmptyWithServiceResponseAsync().map(new Func1, Basic>() { + @Override + public Basic call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a basic complex type that is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable> getEmptyWithServiceResponseAsync() { + return service.getEmpty() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a basic complex type whose properties are null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + public Basic getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a basic complex type whose properties are null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a basic complex type whose properties are null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, Basic>() { + @Override + public Basic call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a basic complex type whose properties are null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a basic complex type while the server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Basic object if successful. + */ + public Basic getNotProvided() { + return getNotProvidedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a basic complex type while the server doesn't provide a response payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNotProvidedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNotProvidedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a basic complex type while the server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable getNotProvidedAsync() { + return getNotProvidedWithServiceResponseAsync().map(new Func1, Basic>() { + @Override + public Basic call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a basic complex type while the server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Basic object + */ + public Observable> getNotProvidedWithServiceResponseAsync() { + return service.getNotProvided() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNotProvidedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNotProvidedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/DictionarysImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/DictionarysImpl.java new file mode 100644 index 0000000000..8cb759c94b --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/DictionarysImpl.java @@ -0,0 +1,494 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import retrofit2.Retrofit; +import fixtures.bodycomplex.Dictionarys; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodycomplex.models.DictionaryWrapper; +import fixtures.bodycomplex.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Dictionarys. + */ +public class DictionarysImpl implements Dictionarys { + /** The Retrofit service to perform REST calls. */ + private DictionarysService service; + /** The service client containing this operation class. */ + private AutoRestComplexTestServiceImpl client; + + /** + * Initializes an instance of Dictionarys. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DictionarysImpl(Retrofit retrofit, AutoRestComplexTestServiceImpl client) { + this.service = retrofit.create(DictionarysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Dictionarys to be + * used by Retrofit to perform actually REST calls. + */ + interface DictionarysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Dictionarys getValid" }) + @GET("complex/dictionary/typed/valid") + Observable> getValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Dictionarys putValid" }) + @PUT("complex/dictionary/typed/valid") + Observable> putValid(@Body DictionaryWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Dictionarys getEmpty" }) + @GET("complex/dictionary/typed/empty") + Observable> getEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Dictionarys putEmpty" }) + @PUT("complex/dictionary/typed/empty") + Observable> putEmpty(@Body DictionaryWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Dictionarys getNull" }) + @GET("complex/dictionary/typed/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Dictionarys getNotProvided" }) + @GET("complex/dictionary/typed/notprovided") + Observable> getNotProvided(); + + } + + /** + * Get complex types with dictionary property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DictionaryWrapper object if successful. + */ + public DictionaryWrapper getValid() { + return getValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with dictionary property. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with dictionary property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + public Observable getValidAsync() { + return getValidWithServiceResponseAsync().map(new Func1, DictionaryWrapper>() { + @Override + public DictionaryWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with dictionary property. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + public Observable> getValidWithServiceResponseAsync() { + return service.getValid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with dictionary property. + * + * @param complexBody Please put a dictionary with 5 key-value pairs: "txt":"notepad", "bmp":"mspaint", "xls":"excel", "exe":"", "":null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putValid(DictionaryWrapper complexBody) { + putValidWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with dictionary property. + * + * @param complexBody Please put a dictionary with 5 key-value pairs: "txt":"notepad", "bmp":"mspaint", "xls":"excel", "exe":"", "":null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putValidAsync(DictionaryWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putValidWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with dictionary property. + * + * @param complexBody Please put a dictionary with 5 key-value pairs: "txt":"notepad", "bmp":"mspaint", "xls":"excel", "exe":"", "":null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putValidAsync(DictionaryWrapper complexBody) { + return putValidWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with dictionary property. + * + * @param complexBody Please put a dictionary with 5 key-value pairs: "txt":"notepad", "bmp":"mspaint", "xls":"excel", "exe":"", "":null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putValidWithServiceResponseAsync(DictionaryWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putValid(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with dictionary property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DictionaryWrapper object if successful. + */ + public DictionaryWrapper getEmpty() { + return getEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with dictionary property which is empty. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with dictionary property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + public Observable getEmptyAsync() { + return getEmptyWithServiceResponseAsync().map(new Func1, DictionaryWrapper>() { + @Override + public DictionaryWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with dictionary property which is empty. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + public Observable> getEmptyWithServiceResponseAsync() { + return service.getEmpty() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with dictionary property which is empty. + * + * @param complexBody Please put an empty dictionary + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putEmpty(DictionaryWrapper complexBody) { + putEmptyWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with dictionary property which is empty. + * + * @param complexBody Please put an empty dictionary + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putEmptyAsync(DictionaryWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putEmptyWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with dictionary property which is empty. + * + * @param complexBody Please put an empty dictionary + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putEmptyAsync(DictionaryWrapper complexBody) { + return putEmptyWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with dictionary property which is empty. + * + * @param complexBody Please put an empty dictionary + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putEmptyWithServiceResponseAsync(DictionaryWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putEmpty(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with dictionary property which is null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DictionaryWrapper object if successful. + */ + public DictionaryWrapper getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with dictionary property which is null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with dictionary property which is null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, DictionaryWrapper>() { + @Override + public DictionaryWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with dictionary property which is null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with dictionary property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DictionaryWrapper object if successful. + */ + public DictionaryWrapper getNotProvided() { + return getNotProvidedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with dictionary property while server doesn't provide a response payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNotProvidedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNotProvidedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with dictionary property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + public Observable getNotProvidedAsync() { + return getNotProvidedWithServiceResponseAsync().map(new Func1, DictionaryWrapper>() { + @Override + public DictionaryWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with dictionary property while server doesn't provide a response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DictionaryWrapper object + */ + public Observable> getNotProvidedWithServiceResponseAsync() { + return service.getNotProvided() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNotProvidedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNotProvidedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/InheritancesImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/InheritancesImpl.java new file mode 100644 index 0000000000..7fd06c45c0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/InheritancesImpl.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import retrofit2.Retrofit; +import fixtures.bodycomplex.Inheritances; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.Siamese; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Inheritances. + */ +public class InheritancesImpl implements Inheritances { + /** The Retrofit service to perform REST calls. */ + private InheritancesService service; + /** The service client containing this operation class. */ + private AutoRestComplexTestServiceImpl client; + + /** + * Initializes an instance of Inheritances. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public InheritancesImpl(Retrofit retrofit, AutoRestComplexTestServiceImpl client) { + this.service = retrofit.create(InheritancesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Inheritances to be + * used by Retrofit to perform actually REST calls. + */ + interface InheritancesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Inheritances getValid" }) + @GET("complex/inheritance/valid") + Observable> getValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Inheritances putValid" }) + @PUT("complex/inheritance/valid") + Observable> putValid(@Body Siamese complexBody); + + } + + /** + * Get complex types that extend others. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Siamese object if successful. + */ + public Siamese getValid() { + return getValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types that extend others. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types that extend others. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Siamese object + */ + public Observable getValidAsync() { + return getValidWithServiceResponseAsync().map(new Func1, Siamese>() { + @Override + public Siamese call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types that extend others. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Siamese object + */ + public Observable> getValidWithServiceResponseAsync() { + return service.getValid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types that extend others. + * + * @param complexBody Please put a siamese with id=2, name="Siameee", color=green, breed=persion, which hates 2 dogs, the 1st one named "Potato" with id=1 and food="tomato", and the 2nd one named "Tomato" with id=-1 and food="french fries". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putValid(Siamese complexBody) { + putValidWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types that extend others. + * + * @param complexBody Please put a siamese with id=2, name="Siameee", color=green, breed=persion, which hates 2 dogs, the 1st one named "Potato" with id=1 and food="tomato", and the 2nd one named "Tomato" with id=-1 and food="french fries". + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putValidAsync(Siamese complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putValidWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types that extend others. + * + * @param complexBody Please put a siamese with id=2, name="Siameee", color=green, breed=persion, which hates 2 dogs, the 1st one named "Potato" with id=1 and food="tomato", and the 2nd one named "Tomato" with id=-1 and food="french fries". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putValidAsync(Siamese complexBody) { + return putValidWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types that extend others. + * + * @param complexBody Please put a siamese with id=2, name="Siameee", color=green, breed=persion, which hates 2 dogs, the 1st one named "Potato" with id=1 and food="tomato", and the 2nd one named "Tomato" with id=-1 and food="french fries". + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putValidWithServiceResponseAsync(Siamese complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putValid(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PolymorphicrecursivesImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PolymorphicrecursivesImpl.java new file mode 100644 index 0000000000..b68c05f54a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PolymorphicrecursivesImpl.java @@ -0,0 +1,415 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import retrofit2.Retrofit; +import fixtures.bodycomplex.Polymorphicrecursives; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.Fish; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Polymorphicrecursives. + */ +public class PolymorphicrecursivesImpl implements Polymorphicrecursives { + /** The Retrofit service to perform REST calls. */ + private PolymorphicrecursivesService service; + /** The service client containing this operation class. */ + private AutoRestComplexTestServiceImpl client; + + /** + * Initializes an instance of Polymorphicrecursives. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PolymorphicrecursivesImpl(Retrofit retrofit, AutoRestComplexTestServiceImpl client) { + this.service = retrofit.create(PolymorphicrecursivesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Polymorphicrecursives to be + * used by Retrofit to perform actually REST calls. + */ + interface PolymorphicrecursivesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Polymorphicrecursives getValid" }) + @GET("complex/polymorphicrecursive/valid") + Observable> getValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Polymorphicrecursives putValid" }) + @PUT("complex/polymorphicrecursive/valid") + Observable> putValid(@Body Fish complexBody); + + } + + /** + * Get complex types that are polymorphic and have recursive references. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Fish object if successful. + */ + public Fish getValid() { + return getValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types that are polymorphic and have recursive references. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types that are polymorphic and have recursive references. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Fish object + */ + public Observable getValidAsync() { + return getValidWithServiceResponseAsync().map(new Func1, Fish>() { + @Override + public Fish call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types that are polymorphic and have recursive references. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Fish object + */ + public Observable> getValidWithServiceResponseAsync() { + return service.getValid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types that are polymorphic and have recursive references. + * + * @param complexBody Please put a salmon that looks like this: + { + "fishtype": "salmon", + "species": "king", + "length": 1, + "age": 1, + "location": "alaska", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6, + "siblings": [ + { + "fishtype": "salmon", + "species": "coho", + "length": 2, + "age": 2, + "location": "atlantic", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putValid(Fish complexBody) { + putValidWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types that are polymorphic and have recursive references. + * + * @param complexBody Please put a salmon that looks like this: + { + "fishtype": "salmon", + "species": "king", + "length": 1, + "age": 1, + "location": "alaska", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6, + "siblings": [ + { + "fishtype": "salmon", + "species": "coho", + "length": 2, + "age": 2, + "location": "atlantic", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + } + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putValidAsync(Fish complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putValidWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types that are polymorphic and have recursive references. + * + * @param complexBody Please put a salmon that looks like this: + { + "fishtype": "salmon", + "species": "king", + "length": 1, + "age": 1, + "location": "alaska", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6, + "siblings": [ + { + "fishtype": "salmon", + "species": "coho", + "length": 2, + "age": 2, + "location": "atlantic", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putValidAsync(Fish complexBody) { + return putValidWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types that are polymorphic and have recursive references. + * + * @param complexBody Please put a salmon that looks like this: + { + "fishtype": "salmon", + "species": "king", + "length": 1, + "age": 1, + "location": "alaska", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6, + "siblings": [ + { + "fishtype": "salmon", + "species": "coho", + "length": 2, + "age": 2, + "location": "atlantic", + "iswild": true, + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putValidWithServiceResponseAsync(Fish complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putValid(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PolymorphismsImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PolymorphismsImpl.java new file mode 100644 index 0000000000..a974d7fc02 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PolymorphismsImpl.java @@ -0,0 +1,512 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import retrofit2.Retrofit; +import fixtures.bodycomplex.Polymorphisms; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.Fish; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Polymorphisms. + */ +public class PolymorphismsImpl implements Polymorphisms { + /** The Retrofit service to perform REST calls. */ + private PolymorphismsService service; + /** The service client containing this operation class. */ + private AutoRestComplexTestServiceImpl client; + + /** + * Initializes an instance of Polymorphisms. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PolymorphismsImpl(Retrofit retrofit, AutoRestComplexTestServiceImpl client) { + this.service = retrofit.create(PolymorphismsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Polymorphisms to be + * used by Retrofit to perform actually REST calls. + */ + interface PolymorphismsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Polymorphisms getValid" }) + @GET("complex/polymorphism/valid") + Observable> getValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Polymorphisms putValid" }) + @PUT("complex/polymorphism/valid") + Observable> putValid(@Body Fish complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Polymorphisms putValidMissingRequired" }) + @PUT("complex/polymorphism/missingrequired/invalid") + Observable> putValidMissingRequired(@Body Fish complexBody); + + } + + /** + * Get complex types that are polymorphic. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Fish object if successful. + */ + public Fish getValid() { + return getValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types that are polymorphic. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types that are polymorphic. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Fish object + */ + public Observable getValidAsync() { + return getValidWithServiceResponseAsync().map(new Func1, Fish>() { + @Override + public Fish call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types that are polymorphic. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Fish object + */ + public Observable> getValidWithServiceResponseAsync() { + return service.getValid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types that are polymorphic. + * + * @param complexBody Please put a salmon that looks like this: + { + 'fishtype':'Salmon', + 'location':'alaska', + 'iswild':true, + 'species':'king', + 'length':1.0, + 'siblings':[ + { + 'fishtype':'Shark', + 'age':6, + 'birthday': '2012-01-05T01:00:00Z', + 'length':20.0, + 'species':'predator', + }, + { + 'fishtype':'Sawshark', + 'age':105, + 'birthday': '1900-01-05T01:00:00Z', + 'length':10.0, + 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), + 'species':'dangerous', + }, + { + 'fishtype': 'goblin', + 'age': 1, + 'birthday': '2015-08-08T00:00:00Z', + 'length': 30.0, + 'species': 'scary', + 'jawsize': 5 + } + ] + }; + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putValid(Fish complexBody) { + putValidWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types that are polymorphic. + * + * @param complexBody Please put a salmon that looks like this: + { + 'fishtype':'Salmon', + 'location':'alaska', + 'iswild':true, + 'species':'king', + 'length':1.0, + 'siblings':[ + { + 'fishtype':'Shark', + 'age':6, + 'birthday': '2012-01-05T01:00:00Z', + 'length':20.0, + 'species':'predator', + }, + { + 'fishtype':'Sawshark', + 'age':105, + 'birthday': '1900-01-05T01:00:00Z', + 'length':10.0, + 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), + 'species':'dangerous', + }, + { + 'fishtype': 'goblin', + 'age': 1, + 'birthday': '2015-08-08T00:00:00Z', + 'length': 30.0, + 'species': 'scary', + 'jawsize': 5 + } + ] + }; + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putValidAsync(Fish complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putValidWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types that are polymorphic. + * + * @param complexBody Please put a salmon that looks like this: + { + 'fishtype':'Salmon', + 'location':'alaska', + 'iswild':true, + 'species':'king', + 'length':1.0, + 'siblings':[ + { + 'fishtype':'Shark', + 'age':6, + 'birthday': '2012-01-05T01:00:00Z', + 'length':20.0, + 'species':'predator', + }, + { + 'fishtype':'Sawshark', + 'age':105, + 'birthday': '1900-01-05T01:00:00Z', + 'length':10.0, + 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), + 'species':'dangerous', + }, + { + 'fishtype': 'goblin', + 'age': 1, + 'birthday': '2015-08-08T00:00:00Z', + 'length': 30.0, + 'species': 'scary', + 'jawsize': 5 + } + ] + }; + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putValidAsync(Fish complexBody) { + return putValidWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types that are polymorphic. + * + * @param complexBody Please put a salmon that looks like this: + { + 'fishtype':'Salmon', + 'location':'alaska', + 'iswild':true, + 'species':'king', + 'length':1.0, + 'siblings':[ + { + 'fishtype':'Shark', + 'age':6, + 'birthday': '2012-01-05T01:00:00Z', + 'length':20.0, + 'species':'predator', + }, + { + 'fishtype':'Sawshark', + 'age':105, + 'birthday': '1900-01-05T01:00:00Z', + 'length':10.0, + 'picture': new Buffer([255, 255, 255, 255, 254]).toString('base64'), + 'species':'dangerous', + }, + { + 'fishtype': 'goblin', + 'age': 1, + 'birthday': '2015-08-08T00:00:00Z', + 'length': 30.0, + 'species': 'scary', + 'jawsize': 5 + } + ] + }; + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putValidWithServiceResponseAsync(Fish complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putValid(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client. + * + * @param complexBody Please attempt put a sawshark that looks like this, the client should not allow this data to be sent: + { + "fishtype": "sawshark", + "species": "snaggle toothed", + "length": 18.5, + "age": 2, + "birthday": "2013-06-01T01:00:00Z", + "location": "alaska", + "picture": base64(FF FF FF FF FE), + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "birthday": "2012-01-05T01:00:00Z", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "picture": base64(FF FF FF FF FE), + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putValidMissingRequired(Fish complexBody) { + putValidMissingRequiredWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client. + * + * @param complexBody Please attempt put a sawshark that looks like this, the client should not allow this data to be sent: + { + "fishtype": "sawshark", + "species": "snaggle toothed", + "length": 18.5, + "age": 2, + "birthday": "2013-06-01T01:00:00Z", + "location": "alaska", + "picture": base64(FF FF FF FF FE), + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "birthday": "2012-01-05T01:00:00Z", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "picture": base64(FF FF FF FF FE), + "length": 10, + "age": 105 + } + ] + } + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putValidMissingRequiredAsync(Fish complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putValidMissingRequiredWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client. + * + * @param complexBody Please attempt put a sawshark that looks like this, the client should not allow this data to be sent: + { + "fishtype": "sawshark", + "species": "snaggle toothed", + "length": 18.5, + "age": 2, + "birthday": "2013-06-01T01:00:00Z", + "location": "alaska", + "picture": base64(FF FF FF FF FE), + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "birthday": "2012-01-05T01:00:00Z", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "picture": base64(FF FF FF FF FE), + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putValidMissingRequiredAsync(Fish complexBody) { + return putValidMissingRequiredWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types that are polymorphic, attempting to omit required 'birthday' field - the request should not be allowed from the client. + * + * @param complexBody Please attempt put a sawshark that looks like this, the client should not allow this data to be sent: + { + "fishtype": "sawshark", + "species": "snaggle toothed", + "length": 18.5, + "age": 2, + "birthday": "2013-06-01T01:00:00Z", + "location": "alaska", + "picture": base64(FF FF FF FF FE), + "siblings": [ + { + "fishtype": "shark", + "species": "predator", + "birthday": "2012-01-05T01:00:00Z", + "length": 20, + "age": 6 + }, + { + "fishtype": "sawshark", + "species": "dangerous", + "picture": base64(FF FF FF FF FE), + "length": 10, + "age": 105 + } + ] + } + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putValidMissingRequiredWithServiceResponseAsync(Fish complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putValidMissingRequired(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putValidMissingRequiredDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putValidMissingRequiredDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PrimitivesImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PrimitivesImpl.java new file mode 100644 index 0000000000..26f32d5a9c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/PrimitivesImpl.java @@ -0,0 +1,1687 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import retrofit2.Retrofit; +import fixtures.bodycomplex.Primitives; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodycomplex.models.BooleanWrapper; +import fixtures.bodycomplex.models.ByteWrapper; +import fixtures.bodycomplex.models.Datetimerfc1123Wrapper; +import fixtures.bodycomplex.models.DatetimeWrapper; +import fixtures.bodycomplex.models.DateWrapper; +import fixtures.bodycomplex.models.DoubleWrapper; +import fixtures.bodycomplex.models.DurationWrapper; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.FloatWrapper; +import fixtures.bodycomplex.models.IntWrapper; +import fixtures.bodycomplex.models.LongWrapper; +import fixtures.bodycomplex.models.StringWrapper; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Primitives. + */ +public class PrimitivesImpl implements Primitives { + /** The Retrofit service to perform REST calls. */ + private PrimitivesService service; + /** The service client containing this operation class. */ + private AutoRestComplexTestServiceImpl client; + + /** + * Initializes an instance of Primitives. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrimitivesImpl(Retrofit retrofit, AutoRestComplexTestServiceImpl client) { + this.service = retrofit.create(PrimitivesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Primitives to be + * used by Retrofit to perform actually REST calls. + */ + interface PrimitivesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getInt" }) + @GET("complex/primitive/integer") + Observable> getInt(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putInt" }) + @PUT("complex/primitive/integer") + Observable> putInt(@Body IntWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getLong" }) + @GET("complex/primitive/long") + Observable> getLong(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putLong" }) + @PUT("complex/primitive/long") + Observable> putLong(@Body LongWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getFloat" }) + @GET("complex/primitive/float") + Observable> getFloat(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putFloat" }) + @PUT("complex/primitive/float") + Observable> putFloat(@Body FloatWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getDouble" }) + @GET("complex/primitive/double") + Observable> getDouble(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putDouble" }) + @PUT("complex/primitive/double") + Observable> putDouble(@Body DoubleWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getBool" }) + @GET("complex/primitive/bool") + Observable> getBool(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putBool" }) + @PUT("complex/primitive/bool") + Observable> putBool(@Body BooleanWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getString" }) + @GET("complex/primitive/string") + Observable> getString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putString" }) + @PUT("complex/primitive/string") + Observable> putString(@Body StringWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getDate" }) + @GET("complex/primitive/date") + Observable> getDate(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putDate" }) + @PUT("complex/primitive/date") + Observable> putDate(@Body DateWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getDateTime" }) + @GET("complex/primitive/datetime") + Observable> getDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putDateTime" }) + @PUT("complex/primitive/datetime") + Observable> putDateTime(@Body DatetimeWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getDateTimeRfc1123" }) + @GET("complex/primitive/datetimerfc1123") + Observable> getDateTimeRfc1123(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putDateTimeRfc1123" }) + @PUT("complex/primitive/datetimerfc1123") + Observable> putDateTimeRfc1123(@Body Datetimerfc1123Wrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getDuration" }) + @GET("complex/primitive/duration") + Observable> getDuration(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putDuration" }) + @PUT("complex/primitive/duration") + Observable> putDuration(@Body DurationWrapper complexBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives getByte" }) + @GET("complex/primitive/byte") + Observable> getByte(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Primitives putByte" }) + @PUT("complex/primitive/byte") + Observable> putByte(@Body ByteWrapper complexBody); + + } + + /** + * Get complex types with integer properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the IntWrapper object if successful. + */ + public IntWrapper getInt() { + return getIntWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with integer properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIntAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIntWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with integer properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntWrapper object + */ + public Observable getIntAsync() { + return getIntWithServiceResponseAsync().map(new Func1, IntWrapper>() { + @Override + public IntWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with integer properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the IntWrapper object + */ + public Observable> getIntWithServiceResponseAsync() { + return service.getInt() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIntDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIntDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with integer properties. + * + * @param complexBody Please put -1 and 2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putInt(IntWrapper complexBody) { + putIntWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with integer properties. + * + * @param complexBody Please put -1 and 2 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putIntAsync(IntWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putIntWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with integer properties. + * + * @param complexBody Please put -1 and 2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putIntAsync(IntWrapper complexBody) { + return putIntWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with integer properties. + * + * @param complexBody Please put -1 and 2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putIntWithServiceResponseAsync(IntWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putInt(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putIntDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putIntDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with long properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LongWrapper object if successful. + */ + public LongWrapper getLong() { + return getLongWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with long properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLongAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLongWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with long properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LongWrapper object + */ + public Observable getLongAsync() { + return getLongWithServiceResponseAsync().map(new Func1, LongWrapper>() { + @Override + public LongWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with long properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LongWrapper object + */ + public Observable> getLongWithServiceResponseAsync() { + return service.getLong() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLongDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLongDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with long properties. + * + * @param complexBody Please put 1099511627775 and -999511627788 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putLong(LongWrapper complexBody) { + putLongWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with long properties. + * + * @param complexBody Please put 1099511627775 and -999511627788 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putLongAsync(LongWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putLongWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with long properties. + * + * @param complexBody Please put 1099511627775 and -999511627788 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putLongAsync(LongWrapper complexBody) { + return putLongWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with long properties. + * + * @param complexBody Please put 1099511627775 and -999511627788 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putLongWithServiceResponseAsync(LongWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putLong(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putLongDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putLongDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with float properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the FloatWrapper object if successful. + */ + public FloatWrapper getFloat() { + return getFloatWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with float properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFloatAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFloatWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with float properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FloatWrapper object + */ + public Observable getFloatAsync() { + return getFloatWithServiceResponseAsync().map(new Func1, FloatWrapper>() { + @Override + public FloatWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with float properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the FloatWrapper object + */ + public Observable> getFloatWithServiceResponseAsync() { + return service.getFloat() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getFloatDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with float properties. + * + * @param complexBody Please put 1.05 and -0.003 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putFloat(FloatWrapper complexBody) { + putFloatWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with float properties. + * + * @param complexBody Please put 1.05 and -0.003 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putFloatAsync(FloatWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putFloatWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with float properties. + * + * @param complexBody Please put 1.05 and -0.003 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putFloatAsync(FloatWrapper complexBody) { + return putFloatWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with float properties. + * + * @param complexBody Please put 1.05 and -0.003 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putFloatWithServiceResponseAsync(FloatWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putFloat(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putFloatDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with double properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DoubleWrapper object if successful. + */ + public DoubleWrapper getDouble() { + return getDoubleWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with double properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDoubleAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDoubleWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with double properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DoubleWrapper object + */ + public Observable getDoubleAsync() { + return getDoubleWithServiceResponseAsync().map(new Func1, DoubleWrapper>() { + @Override + public DoubleWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with double properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DoubleWrapper object + */ + public Observable> getDoubleWithServiceResponseAsync() { + return service.getDouble() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDoubleDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with double properties. + * + * @param complexBody Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDouble(DoubleWrapper complexBody) { + putDoubleWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with double properties. + * + * @param complexBody Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDoubleAsync(DoubleWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDoubleWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with double properties. + * + * @param complexBody Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDoubleAsync(DoubleWrapper complexBody) { + return putDoubleWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with double properties. + * + * @param complexBody Please put 3e-100 and -0.000000000000000000000000000000000000000000000000000000005 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDoubleWithServiceResponseAsync(DoubleWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putDouble(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDoubleDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with bool properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BooleanWrapper object if successful. + */ + public BooleanWrapper getBool() { + return getBoolWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with bool properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBoolAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBoolWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with bool properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BooleanWrapper object + */ + public Observable getBoolAsync() { + return getBoolWithServiceResponseAsync().map(new Func1, BooleanWrapper>() { + @Override + public BooleanWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with bool properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BooleanWrapper object + */ + public Observable> getBoolWithServiceResponseAsync() { + return service.getBool() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBoolDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBoolDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with bool properties. + * + * @param complexBody Please put true and false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBool(BooleanWrapper complexBody) { + putBoolWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with bool properties. + * + * @param complexBody Please put true and false + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBoolAsync(BooleanWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBoolWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with bool properties. + * + * @param complexBody Please put true and false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBoolAsync(BooleanWrapper complexBody) { + return putBoolWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with bool properties. + * + * @param complexBody Please put true and false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBoolWithServiceResponseAsync(BooleanWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putBool(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBoolDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBoolDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with string properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StringWrapper object if successful. + */ + public StringWrapper getString() { + return getStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with string properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getStringAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with string properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StringWrapper object + */ + public Observable getStringAsync() { + return getStringWithServiceResponseAsync().map(new Func1, StringWrapper>() { + @Override + public StringWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with string properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StringWrapper object + */ + public Observable> getStringWithServiceResponseAsync() { + return service.getString() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with string properties. + * + * @param complexBody Please put 'goodrequest', '', and null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putString(StringWrapper complexBody) { + putStringWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with string properties. + * + * @param complexBody Please put 'goodrequest', '', and null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putStringAsync(StringWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putStringWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with string properties. + * + * @param complexBody Please put 'goodrequest', '', and null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putStringAsync(StringWrapper complexBody) { + return putStringWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with string properties. + * + * @param complexBody Please put 'goodrequest', '', and null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putStringWithServiceResponseAsync(StringWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putString(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putStringDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with date properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateWrapper object if successful. + */ + public DateWrapper getDate() { + return getDateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with date properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with date properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateWrapper object + */ + public Observable getDateAsync() { + return getDateWithServiceResponseAsync().map(new Func1, DateWrapper>() { + @Override + public DateWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with date properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateWrapper object + */ + public Observable> getDateWithServiceResponseAsync() { + return service.getDate() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDateDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with date properties. + * + * @param complexBody Please put '0001-01-01' and '2016-02-29' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDate(DateWrapper complexBody) { + putDateWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with date properties. + * + * @param complexBody Please put '0001-01-01' and '2016-02-29' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateAsync(DateWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with date properties. + * + * @param complexBody Please put '0001-01-01' and '2016-02-29' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateAsync(DateWrapper complexBody) { + return putDateWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with date properties. + * + * @param complexBody Please put '0001-01-01' and '2016-02-29' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateWithServiceResponseAsync(DateWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putDate(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with datetime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DatetimeWrapper object if successful. + */ + public DatetimeWrapper getDateTime() { + return getDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with datetime properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with datetime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatetimeWrapper object + */ + public Observable getDateTimeAsync() { + return getDateTimeWithServiceResponseAsync().map(new Func1, DatetimeWrapper>() { + @Override + public DatetimeWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with datetime properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DatetimeWrapper object + */ + public Observable> getDateTimeWithServiceResponseAsync() { + return service.getDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with datetime properties. + * + * @param complexBody Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDateTime(DatetimeWrapper complexBody) { + putDateTimeWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with datetime properties. + * + * @param complexBody Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateTimeAsync(DatetimeWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateTimeWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with datetime properties. + * + * @param complexBody Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateTimeAsync(DatetimeWrapper complexBody) { + return putDateTimeWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with datetime properties. + * + * @param complexBody Please put '0001-01-01T12:00:00-04:00' and '2015-05-18T11:38:00-08:00' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateTimeWithServiceResponseAsync(DatetimeWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putDateTime(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with datetimeRfc1123 properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Datetimerfc1123Wrapper object if successful. + */ + public Datetimerfc1123Wrapper getDateTimeRfc1123() { + return getDateTimeRfc1123WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with datetimeRfc1123 properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDateTimeRfc1123Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeRfc1123WithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with datetimeRfc1123 properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Datetimerfc1123Wrapper object + */ + public Observable getDateTimeRfc1123Async() { + return getDateTimeRfc1123WithServiceResponseAsync().map(new Func1, Datetimerfc1123Wrapper>() { + @Override + public Datetimerfc1123Wrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with datetimeRfc1123 properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Datetimerfc1123Wrapper object + */ + public Observable> getDateTimeRfc1123WithServiceResponseAsync() { + return service.getDateTimeRfc1123() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDateTimeRfc1123Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDateTimeRfc1123Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with datetimeRfc1123 properties. + * + * @param complexBody Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDateTimeRfc1123(Datetimerfc1123Wrapper complexBody) { + putDateTimeRfc1123WithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with datetimeRfc1123 properties. + * + * @param complexBody Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateTimeRfc1123Async(Datetimerfc1123Wrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateTimeRfc1123WithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with datetimeRfc1123 properties. + * + * @param complexBody Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateTimeRfc1123Async(Datetimerfc1123Wrapper complexBody) { + return putDateTimeRfc1123WithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with datetimeRfc1123 properties. + * + * @param complexBody Please put 'Mon, 01 Jan 0001 12:00:00 GMT' and 'Mon, 18 May 2015 11:38:00 GMT' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateTimeRfc1123WithServiceResponseAsync(Datetimerfc1123Wrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putDateTimeRfc1123(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateTimeRfc1123Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateTimeRfc1123Delegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with duration properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DurationWrapper object if successful. + */ + public DurationWrapper getDuration() { + return getDurationWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with duration properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDurationAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDurationWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with duration properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DurationWrapper object + */ + public Observable getDurationAsync() { + return getDurationWithServiceResponseAsync().map(new Func1, DurationWrapper>() { + @Override + public DurationWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with duration properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DurationWrapper object + */ + public Observable> getDurationWithServiceResponseAsync() { + return service.getDuration() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDurationDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with duration properties. + * + * @param complexBody Please put 'P123DT22H14M12.011S' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDuration(DurationWrapper complexBody) { + putDurationWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with duration properties. + * + * @param complexBody Please put 'P123DT22H14M12.011S' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDurationAsync(DurationWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDurationWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with duration properties. + * + * @param complexBody Please put 'P123DT22H14M12.011S' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDurationAsync(DurationWrapper complexBody) { + return putDurationWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with duration properties. + * + * @param complexBody Please put 'P123DT22H14M12.011S' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDurationWithServiceResponseAsync(DurationWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putDuration(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDurationDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get complex types with byte properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ByteWrapper object if successful. + */ + public ByteWrapper getByte() { + return getByteWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types with byte properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByteAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByteWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types with byte properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ByteWrapper object + */ + public Observable getByteAsync() { + return getByteWithServiceResponseAsync().map(new Func1, ByteWrapper>() { + @Override + public ByteWrapper call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types with byte properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ByteWrapper object + */ + public Observable> getByteWithServiceResponseAsync() { + return service.getByte() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByteDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types with byte properties. + * + * @param complexBody Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putByte(ByteWrapper complexBody) { + putByteWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types with byte properties. + * + * @param complexBody Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putByteAsync(ByteWrapper complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putByteWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types with byte properties. + * + * @param complexBody Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putByteAsync(ByteWrapper complexBody) { + return putByteWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types with byte properties. + * + * @param complexBody Please put non-ascii byte string hex(FF FE FD FC 00 FA F9 F8 F7 F6) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putByteWithServiceResponseAsync(ByteWrapper complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putByte(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putByteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putByteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/ReadonlypropertysImpl.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/ReadonlypropertysImpl.java new file mode 100644 index 0000000000..b6a815427b --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/ReadonlypropertysImpl.java @@ -0,0 +1,207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.implementation; + +import retrofit2.Retrofit; +import fixtures.bodycomplex.Readonlypropertys; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodycomplex.models.ErrorException; +import fixtures.bodycomplex.models.ReadonlyObj; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Readonlypropertys. + */ +public class ReadonlypropertysImpl implements Readonlypropertys { + /** The Retrofit service to perform REST calls. */ + private ReadonlypropertysService service; + /** The service client containing this operation class. */ + private AutoRestComplexTestServiceImpl client; + + /** + * Initializes an instance of Readonlypropertys. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReadonlypropertysImpl(Retrofit retrofit, AutoRestComplexTestServiceImpl client) { + this.service = retrofit.create(ReadonlypropertysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Readonlypropertys to be + * used by Retrofit to perform actually REST calls. + */ + interface ReadonlypropertysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Readonlypropertys getValid" }) + @GET("complex/readonlyproperty/valid") + Observable> getValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodycomplex.Readonlypropertys putValid" }) + @PUT("complex/readonlyproperty/valid") + Observable> putValid(@Body ReadonlyObj complexBody); + + } + + /** + * Get complex types that have readonly properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReadonlyObj object if successful. + */ + public ReadonlyObj getValid() { + return getValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get complex types that have readonly properties. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get complex types that have readonly properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReadonlyObj object + */ + public Observable getValidAsync() { + return getValidWithServiceResponseAsync().map(new Func1, ReadonlyObj>() { + @Override + public ReadonlyObj call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get complex types that have readonly properties. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReadonlyObj object + */ + public Observable> getValidWithServiceResponseAsync() { + return service.getValid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put complex types that have readonly properties. + * + * @param complexBody the ReadonlyObj value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putValid(ReadonlyObj complexBody) { + putValidWithServiceResponseAsync(complexBody).toBlocking().single().body(); + } + + /** + * Put complex types that have readonly properties. + * + * @param complexBody the ReadonlyObj value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putValidAsync(ReadonlyObj complexBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putValidWithServiceResponseAsync(complexBody), serviceCallback); + } + + /** + * Put complex types that have readonly properties. + * + * @param complexBody the ReadonlyObj value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putValidAsync(ReadonlyObj complexBody) { + return putValidWithServiceResponseAsync(complexBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put complex types that have readonly properties. + * + * @param complexBody the ReadonlyObj value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putValidWithServiceResponseAsync(ReadonlyObj complexBody) { + if (complexBody == null) { + throw new IllegalArgumentException("Parameter complexBody is required and cannot be null."); + } + Validator.validate(complexBody); + return service.putValid(complexBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/package-info.java new file mode 100644 index 0000000000..d9e093bf11 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestComplexTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodycomplex.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/ArrayWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/ArrayWrapper.java new file mode 100644 index 0000000000..9b1f5d64ff --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/ArrayWrapper.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ArrayWrapper model. + */ +public class ArrayWrapper { + /** + * The array property. + */ + @JsonProperty(value = "array") + private List array; + + /** + * Get the array value. + * + * @return the array value + */ + public List array() { + return this.array; + } + + /** + * Set the array value. + * + * @param array the array value to set + * @return the ArrayWrapper object itself. + */ + public ArrayWrapper withArray(List array) { + this.array = array; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Basic.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Basic.java new file mode 100644 index 0000000000..4d40c7fcc6 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Basic.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Basic model. + */ +public class Basic { + /** + * Basic Id. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * Name property with a very long description that does not fit on a single + * line and a line break. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Possible values include: 'cyan', 'Magenta', 'YELLOW', 'blacK'. + */ + @JsonProperty(value = "color") + private CMYKColors color; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the Basic object itself. + */ + public Basic withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Basic object itself. + */ + public Basic withName(String name) { + this.name = name; + return this; + } + + /** + * Get the color value. + * + * @return the color value + */ + public CMYKColors color() { + return this.color; + } + + /** + * Set the color value. + * + * @param color the color value to set + * @return the Basic object itself. + */ + public Basic withColor(CMYKColors color) { + this.color = color; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/BooleanWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/BooleanWrapper.java new file mode 100644 index 0000000000..4a5ae99290 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/BooleanWrapper.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The BooleanWrapper model. + */ +public class BooleanWrapper { + /** + * The fieldTrue property. + */ + @JsonProperty(value = "field_true") + private Boolean fieldTrue; + + /** + * The fieldFalse property. + */ + @JsonProperty(value = "field_false") + private Boolean fieldFalse; + + /** + * Get the fieldTrue value. + * + * @return the fieldTrue value + */ + public Boolean fieldTrue() { + return this.fieldTrue; + } + + /** + * Set the fieldTrue value. + * + * @param fieldTrue the fieldTrue value to set + * @return the BooleanWrapper object itself. + */ + public BooleanWrapper withFieldTrue(Boolean fieldTrue) { + this.fieldTrue = fieldTrue; + return this; + } + + /** + * Get the fieldFalse value. + * + * @return the fieldFalse value + */ + public Boolean fieldFalse() { + return this.fieldFalse; + } + + /** + * Set the fieldFalse value. + * + * @param fieldFalse the fieldFalse value to set + * @return the BooleanWrapper object itself. + */ + public BooleanWrapper withFieldFalse(Boolean fieldFalse) { + this.fieldFalse = fieldFalse; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/ByteWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/ByteWrapper.java new file mode 100644 index 0000000000..d569b4429c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/ByteWrapper.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ByteWrapper model. + */ +public class ByteWrapper { + /** + * The field property. + */ + @JsonProperty(value = "field") + private byte[] field; + + /** + * Get the field value. + * + * @return the field value + */ + public byte[] field() { + return this.field; + } + + /** + * Set the field value. + * + * @param field the field value to set + * @return the ByteWrapper object itself. + */ + public ByteWrapper withField(byte[] field) { + this.field = field; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/CMYKColors.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/CMYKColors.java new file mode 100644 index 0000000000..f23a566863 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/CMYKColors.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for CMYKColors. + */ +public final class CMYKColors { + /** Static value cyan for CMYKColors. */ + public static final CMYKColors CYAN = new CMYKColors("cyan"); + + /** Static value Magenta for CMYKColors. */ + public static final CMYKColors MAGENTA = new CMYKColors("Magenta"); + + /** Static value YELLOW for CMYKColors. */ + public static final CMYKColors YELLOW = new CMYKColors("YELLOW"); + + /** Static value blacK for CMYKColors. */ + public static final CMYKColors BLACK = new CMYKColors("blacK"); + + private String value; + + /** + * Creates a custom value for CMYKColors. + * @param value the custom value + */ + public CMYKColors(String value) { + this.value = value; + } + + @JsonValue + @Override + public String toString() { + return value; + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof CMYKColors)) { + return false; + } + if (obj == this) { + return true; + } + CMYKColors rhs = (CMYKColors) obj; + if (value == null) { + return rhs.value == null; + } else { + return value.equals(rhs.value); + } + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Cat.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Cat.java new file mode 100644 index 0000000000..461f1ff0b4 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Cat.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Cat model. + */ +public class Cat extends Pet { + /** + * The color property. + */ + @JsonProperty(value = "color") + private String color; + + /** + * The hates property. + */ + @JsonProperty(value = "hates") + private List hates; + + /** + * Get the color value. + * + * @return the color value + */ + public String color() { + return this.color; + } + + /** + * Set the color value. + * + * @param color the color value to set + * @return the Cat object itself. + */ + public Cat withColor(String color) { + this.color = color; + return this; + } + + /** + * Get the hates value. + * + * @return the hates value + */ + public List hates() { + return this.hates; + } + + /** + * Set the hates value. + * + * @param hates the hates value to set + * @return the Cat object itself. + */ + public Cat withHates(List hates) { + this.hates = hates; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Cookiecuttershark.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Cookiecuttershark.java new file mode 100644 index 0000000000..640a850a25 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Cookiecuttershark.java @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The Cookiecuttershark model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "fishtype") +@JsonTypeName("cookiecuttershark") +public class Cookiecuttershark extends Shark { +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DateWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DateWrapper.java new file mode 100644 index 0000000000..7afccb01e9 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DateWrapper.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import org.joda.time.LocalDate; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DateWrapper model. + */ +public class DateWrapper { + /** + * The field property. + */ + @JsonProperty(value = "field") + private LocalDate field; + + /** + * The leap property. + */ + @JsonProperty(value = "leap") + private LocalDate leap; + + /** + * Get the field value. + * + * @return the field value + */ + public LocalDate field() { + return this.field; + } + + /** + * Set the field value. + * + * @param field the field value to set + * @return the DateWrapper object itself. + */ + public DateWrapper withField(LocalDate field) { + this.field = field; + return this; + } + + /** + * Get the leap value. + * + * @return the leap value + */ + public LocalDate leap() { + return this.leap; + } + + /** + * Set the leap value. + * + * @param leap the leap value to set + * @return the DateWrapper object itself. + */ + public DateWrapper withLeap(LocalDate leap) { + this.leap = leap; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DatetimeWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DatetimeWrapper.java new file mode 100644 index 0000000000..02be46de1a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DatetimeWrapper.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DatetimeWrapper model. + */ +public class DatetimeWrapper { + /** + * The field property. + */ + @JsonProperty(value = "field") + private DateTime field; + + /** + * The now property. + */ + @JsonProperty(value = "now") + private DateTime now; + + /** + * Get the field value. + * + * @return the field value + */ + public DateTime field() { + return this.field; + } + + /** + * Set the field value. + * + * @param field the field value to set + * @return the DatetimeWrapper object itself. + */ + public DatetimeWrapper withField(DateTime field) { + this.field = field; + return this; + } + + /** + * Get the now value. + * + * @return the now value + */ + public DateTime now() { + return this.now; + } + + /** + * Set the now value. + * + * @param now the now value to set + * @return the DatetimeWrapper object itself. + */ + public DatetimeWrapper withNow(DateTime now) { + this.now = now; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Datetimerfc1123Wrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Datetimerfc1123Wrapper.java new file mode 100644 index 0000000000..e5b914146e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Datetimerfc1123Wrapper.java @@ -0,0 +1,87 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Datetimerfc1123Wrapper model. + */ +public class Datetimerfc1123Wrapper { + /** + * The field property. + */ + @JsonProperty(value = "field") + private DateTimeRfc1123 field; + + /** + * The now property. + */ + @JsonProperty(value = "now") + private DateTimeRfc1123 now; + + /** + * Get the field value. + * + * @return the field value + */ + public DateTime field() { + if (this.field == null) { + return null; + } + return this.field.dateTime(); + } + + /** + * Set the field value. + * + * @param field the field value to set + * @return the Datetimerfc1123Wrapper object itself. + */ + public Datetimerfc1123Wrapper withField(DateTime field) { + if (field == null) { + this.field = null; + } else { + this.field = new DateTimeRfc1123(field); + } + return this; + } + + /** + * Get the now value. + * + * @return the now value + */ + public DateTime now() { + if (this.now == null) { + return null; + } + return this.now.dateTime(); + } + + /** + * Set the now value. + * + * @param now the now value to set + * @return the Datetimerfc1123Wrapper object itself. + */ + public Datetimerfc1123Wrapper withNow(DateTime now) { + if (now == null) { + this.now = null; + } else { + this.now = new DateTimeRfc1123(now); + } + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DictionaryWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DictionaryWrapper.java new file mode 100644 index 0000000000..d698595991 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DictionaryWrapper.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DictionaryWrapper model. + */ +public class DictionaryWrapper { + /** + * The defaultProgram property. + */ + @JsonProperty(value = "defaultProgram") + private Map defaultProgram; + + /** + * Get the defaultProgram value. + * + * @return the defaultProgram value + */ + public Map defaultProgram() { + return this.defaultProgram; + } + + /** + * Set the defaultProgram value. + * + * @param defaultProgram the defaultProgram value to set + * @return the DictionaryWrapper object itself. + */ + public DictionaryWrapper withDefaultProgram(Map defaultProgram) { + this.defaultProgram = defaultProgram; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Dog.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Dog.java new file mode 100644 index 0000000000..2f8ee4143e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Dog.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Dog model. + */ +public class Dog extends Pet { + /** + * The food property. + */ + @JsonProperty(value = "food") + private String food; + + /** + * Get the food value. + * + * @return the food value + */ + public String food() { + return this.food; + } + + /** + * Set the food value. + * + * @param food the food value to set + * @return the Dog object itself. + */ + public Dog withFood(String food) { + this.food = food; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DoubleWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DoubleWrapper.java new file mode 100644 index 0000000000..f7b6c4759f --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DoubleWrapper.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DoubleWrapper model. + */ +public class DoubleWrapper { + /** + * The field1 property. + */ + @JsonProperty(value = "field1") + private Double field1; + + /** + * The + * field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose + * property. + */ + @JsonProperty(value = "field_56_zeros_after_the_dot_and_negative_zero_before_dot_and_this_is_a_long_field_name_on_purpose") + private Double field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose; + + /** + * Get the field1 value. + * + * @return the field1 value + */ + public Double field1() { + return this.field1; + } + + /** + * Set the field1 value. + * + * @param field1 the field1 value to set + * @return the DoubleWrapper object itself. + */ + public DoubleWrapper withField1(Double field1) { + this.field1 = field1; + return this; + } + + /** + * Get the field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose value. + * + * @return the field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose value + */ + public Double field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose() { + return this.field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose; + } + + /** + * Set the field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose value. + * + * @param field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose the field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose value to set + * @return the DoubleWrapper object itself. + */ + public DoubleWrapper withField56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose(Double field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose) { + this.field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose = field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/DurationWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DurationWrapper.java new file mode 100644 index 0000000000..641f27e842 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/DurationWrapper.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The DurationWrapper model. + */ +public class DurationWrapper { + /** + * The field property. + */ + @JsonProperty(value = "field") + private Period field; + + /** + * Get the field value. + * + * @return the field value + */ + public Period field() { + return this.field; + } + + /** + * Set the field value. + * + * @param field the field value to set + * @return the DurationWrapper object itself. + */ + public DurationWrapper withField(Period field) { + this.field = field; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Error.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Error.java new file mode 100644 index 0000000000..792cc041dd --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/ErrorException.java new file mode 100644 index 0000000000..1547ce55ad --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Fish.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Fish.java new file mode 100644 index 0000000000..4d4f944c89 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Fish.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The Fish model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "fishtype") +@JsonTypeName("Fish") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "salmon", value = Salmon.class), + @JsonSubTypes.Type(name = "shark", value = Shark.class) +}) +public class Fish { + /** + * The species property. + */ + @JsonProperty(value = "species") + private String species; + + /** + * The length property. + */ + @JsonProperty(value = "length", required = true) + private double length; + + /** + * The siblings property. + */ + @JsonProperty(value = "siblings") + private List siblings; + + /** + * Get the species value. + * + * @return the species value + */ + public String species() { + return this.species; + } + + /** + * Set the species value. + * + * @param species the species value to set + * @return the Fish object itself. + */ + public Fish withSpecies(String species) { + this.species = species; + return this; + } + + /** + * Get the length value. + * + * @return the length value + */ + public double length() { + return this.length; + } + + /** + * Set the length value. + * + * @param length the length value to set + * @return the Fish object itself. + */ + public Fish withLength(double length) { + this.length = length; + return this; + } + + /** + * Get the siblings value. + * + * @return the siblings value + */ + public List siblings() { + return this.siblings; + } + + /** + * Set the siblings value. + * + * @param siblings the siblings value to set + * @return the Fish object itself. + */ + public Fish withSiblings(List siblings) { + this.siblings = siblings; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/FloatWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/FloatWrapper.java new file mode 100644 index 0000000000..3aabc8f0a4 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/FloatWrapper.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The FloatWrapper model. + */ +public class FloatWrapper { + /** + * The field1 property. + */ + @JsonProperty(value = "field1") + private Double field1; + + /** + * The field2 property. + */ + @JsonProperty(value = "field2") + private Double field2; + + /** + * Get the field1 value. + * + * @return the field1 value + */ + public Double field1() { + return this.field1; + } + + /** + * Set the field1 value. + * + * @param field1 the field1 value to set + * @return the FloatWrapper object itself. + */ + public FloatWrapper withField1(Double field1) { + this.field1 = field1; + return this; + } + + /** + * Get the field2 value. + * + * @return the field2 value + */ + public Double field2() { + return this.field2; + } + + /** + * Set the field2 value. + * + * @param field2 the field2 value to set + * @return the FloatWrapper object itself. + */ + public FloatWrapper withField2(Double field2) { + this.field2 = field2; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Goblinshark.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Goblinshark.java new file mode 100644 index 0000000000..c97392c17b --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Goblinshark.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The Goblinshark model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "fishtype") +@JsonTypeName("goblin") +public class Goblinshark extends Shark { + /** + * The jawsize property. + */ + @JsonProperty(value = "jawsize") + private Integer jawsize; + + /** + * Get the jawsize value. + * + * @return the jawsize value + */ + public Integer jawsize() { + return this.jawsize; + } + + /** + * Set the jawsize value. + * + * @param jawsize the jawsize value to set + * @return the Goblinshark object itself. + */ + public Goblinshark withJawsize(Integer jawsize) { + this.jawsize = jawsize; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/IntWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/IntWrapper.java new file mode 100644 index 0000000000..bdaa9e9f7f --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/IntWrapper.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IntWrapper model. + */ +public class IntWrapper { + /** + * The field1 property. + */ + @JsonProperty(value = "field1") + private Integer field1; + + /** + * The field2 property. + */ + @JsonProperty(value = "field2") + private Integer field2; + + /** + * Get the field1 value. + * + * @return the field1 value + */ + public Integer field1() { + return this.field1; + } + + /** + * Set the field1 value. + * + * @param field1 the field1 value to set + * @return the IntWrapper object itself. + */ + public IntWrapper withField1(Integer field1) { + this.field1 = field1; + return this; + } + + /** + * Get the field2 value. + * + * @return the field2 value + */ + public Integer field2() { + return this.field2; + } + + /** + * Set the field2 value. + * + * @param field2 the field2 value to set + * @return the IntWrapper object itself. + */ + public IntWrapper withField2(Integer field2) { + this.field2 = field2; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/LongWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/LongWrapper.java new file mode 100644 index 0000000000..ab5aba3d20 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/LongWrapper.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The LongWrapper model. + */ +public class LongWrapper { + /** + * The field1 property. + */ + @JsonProperty(value = "field1") + private Long field1; + + /** + * The field2 property. + */ + @JsonProperty(value = "field2") + private Long field2; + + /** + * Get the field1 value. + * + * @return the field1 value + */ + public Long field1() { + return this.field1; + } + + /** + * Set the field1 value. + * + * @param field1 the field1 value to set + * @return the LongWrapper object itself. + */ + public LongWrapper withField1(Long field1) { + this.field1 = field1; + return this; + } + + /** + * Get the field2 value. + * + * @return the field2 value + */ + public Long field2() { + return this.field2; + } + + /** + * Set the field2 value. + * + * @param field2 the field2 value to set + * @return the LongWrapper object itself. + */ + public LongWrapper withField2(Long field2) { + this.field2 = field2; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Pet.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Pet.java new file mode 100644 index 0000000000..01512f12df --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Pet.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Pet model. + */ +public class Pet { + /** + * The id property. + */ + @JsonProperty(value = "id") + private Integer id; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the id value. + * + * @return the id value + */ + public Integer id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the Pet object itself. + */ + public Pet withId(Integer id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Pet object itself. + */ + public Pet withName(String name) { + this.name = name; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/ReadonlyObj.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/ReadonlyObj.java new file mode 100644 index 0000000000..0570ba6034 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/ReadonlyObj.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ReadonlyObj model. + */ +public class ReadonlyObj { + /** + * The id property. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The size property. + */ + @JsonProperty(value = "size") + private Integer size; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the size value. + * + * @return the size value + */ + public Integer size() { + return this.size; + } + + /** + * Set the size value. + * + * @param size the size value to set + * @return the ReadonlyObj object itself. + */ + public ReadonlyObj withSize(Integer size) { + this.size = size; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Salmon.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Salmon.java new file mode 100644 index 0000000000..e43777b168 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Salmon.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The Salmon model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "fishtype") +@JsonTypeName("salmon") +public class Salmon extends Fish { + /** + * The location property. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The iswild property. + */ + @JsonProperty(value = "iswild") + private Boolean iswild; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the Salmon object itself. + */ + public Salmon withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the iswild value. + * + * @return the iswild value + */ + public Boolean iswild() { + return this.iswild; + } + + /** + * Set the iswild value. + * + * @param iswild the iswild value to set + * @return the Salmon object itself. + */ + public Salmon withIswild(Boolean iswild) { + this.iswild = iswild; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Sawshark.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Sawshark.java new file mode 100644 index 0000000000..79805c23cf --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Sawshark.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The Sawshark model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "fishtype") +@JsonTypeName("sawshark") +public class Sawshark extends Shark { + /** + * The picture property. + */ + @JsonProperty(value = "picture") + private byte[] picture; + + /** + * Get the picture value. + * + * @return the picture value + */ + public byte[] picture() { + return this.picture; + } + + /** + * Set the picture value. + * + * @param picture the picture value to set + * @return the Sawshark object itself. + */ + public Sawshark withPicture(byte[] picture) { + this.picture = picture; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Shark.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Shark.java new file mode 100644 index 0000000000..e04a52ea18 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Shark.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The Shark model. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "fishtype") +@JsonTypeName("shark") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "sawshark", value = Sawshark.class), + @JsonSubTypes.Type(name = "goblin", value = Goblinshark.class), + @JsonSubTypes.Type(name = "cookiecuttershark", value = Cookiecuttershark.class) +}) +public class Shark extends Fish { + /** + * The age property. + */ + @JsonProperty(value = "age") + private Integer age; + + /** + * The birthday property. + */ + @JsonProperty(value = "birthday", required = true) + private DateTime birthday; + + /** + * Get the age value. + * + * @return the age value + */ + public Integer age() { + return this.age; + } + + /** + * Set the age value. + * + * @param age the age value to set + * @return the Shark object itself. + */ + public Shark withAge(Integer age) { + this.age = age; + return this; + } + + /** + * Get the birthday value. + * + * @return the birthday value + */ + public DateTime birthday() { + return this.birthday; + } + + /** + * Set the birthday value. + * + * @param birthday the birthday value to set + * @return the Shark object itself. + */ + public Shark withBirthday(DateTime birthday) { + this.birthday = birthday; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/Siamese.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Siamese.java new file mode 100644 index 0000000000..c6ce009cda --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/Siamese.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Siamese model. + */ +public class Siamese extends Cat { + /** + * The breed property. + */ + @JsonProperty(value = "breed") + private String breed; + + /** + * Get the breed value. + * + * @return the breed value + */ + public String breed() { + return this.breed; + } + + /** + * Set the breed value. + * + * @param breed the breed value to set + * @return the Siamese object itself. + */ + public Siamese withBreed(String breed) { + this.breed = breed; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/StringWrapper.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/StringWrapper.java new file mode 100644 index 0000000000..b6c2bb4135 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/StringWrapper.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodycomplex.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The StringWrapper model. + */ +public class StringWrapper { + /** + * The field property. + */ + @JsonProperty(value = "field") + private String field; + + /** + * The empty property. + */ + @JsonProperty(value = "empty") + private String empty; + + /** + * The nullProperty property. + */ + @JsonProperty(value = "null") + private String nullProperty; + + /** + * Get the field value. + * + * @return the field value + */ + public String field() { + return this.field; + } + + /** + * Set the field value. + * + * @param field the field value to set + * @return the StringWrapper object itself. + */ + public StringWrapper withField(String field) { + this.field = field; + return this; + } + + /** + * Get the empty value. + * + * @return the empty value + */ + public String empty() { + return this.empty; + } + + /** + * Set the empty value. + * + * @param empty the empty value to set + * @return the StringWrapper object itself. + */ + public StringWrapper withEmpty(String empty) { + this.empty = empty; + return this; + } + + /** + * Get the nullProperty value. + * + * @return the nullProperty value + */ + public String nullProperty() { + return this.nullProperty; + } + + /** + * Set the nullProperty value. + * + * @param nullProperty the nullProperty value to set + * @return the StringWrapper object itself. + */ + public StringWrapper withNullProperty(String nullProperty) { + this.nullProperty = nullProperty; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodycomplex/models/package-info.java new file mode 100644 index 0000000000..5287b511cf --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestComplexTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodycomplex.models; diff --git a/test/vanilla/src/main/java/fixtures/bodycomplex/package-info.java b/test/vanilla/src/main/java/fixtures/bodycomplex/package-info.java new file mode 100644 index 0000000000..c3fa547428 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodycomplex/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestComplexTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodycomplex; diff --git a/test/vanilla/src/main/java/fixtures/bodydate/AutoRestDateTestService.java b/test/vanilla/src/main/java/fixtures/bodydate/AutoRestDateTestService.java new file mode 100644 index 0000000000..19ae2008ca --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/AutoRestDateTestService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydate; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestDateTestService class. + */ +public interface AutoRestDateTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "https://localhost"; + + /** + * Gets the Dates object to access its operations. + * @return the Dates object. + */ + Dates dates(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydate/Dates.java b/test/vanilla/src/main/java/fixtures/bodydate/Dates.java new file mode 100644 index 0000000000..214e27f77d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/Dates.java @@ -0,0 +1,312 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydate; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodydate.models.ErrorException; +import java.io.IOException; +import org.joda.time.LocalDate; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Dates. + */ +public interface Dates { + /** + * Get null date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + LocalDate getNull(); + + /** + * Get null date value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable getNullAsync(); + + /** + * Get null date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get invalid date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + LocalDate getInvalidDate(); + + /** + * Get invalid date value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidDateAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable getInvalidDateAsync(); + + /** + * Get invalid date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable> getInvalidDateWithServiceResponseAsync(); + + /** + * Get overflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + LocalDate getOverflowDate(); + + /** + * Get overflow date value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getOverflowDateAsync(final ServiceCallback serviceCallback); + + /** + * Get overflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable getOverflowDateAsync(); + + /** + * Get overflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable> getOverflowDateWithServiceResponseAsync(); + + /** + * Get underflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + LocalDate getUnderflowDate(); + + /** + * Get underflow date value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUnderflowDateAsync(final ServiceCallback serviceCallback); + + /** + * Get underflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable getUnderflowDateAsync(); + + /** + * Get underflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable> getUnderflowDateWithServiceResponseAsync(); + + /** + * Put max date value 9999-12-31. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putMaxDate(LocalDate dateBody); + + /** + * Put max date value 9999-12-31. + * + * @param dateBody the LocalDate value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putMaxDateAsync(LocalDate dateBody, final ServiceCallback serviceCallback); + + /** + * Put max date value 9999-12-31. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putMaxDateAsync(LocalDate dateBody); + + /** + * Put max date value 9999-12-31. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putMaxDateWithServiceResponseAsync(LocalDate dateBody); + + /** + * Get max date value 9999-12-31. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + LocalDate getMaxDate(); + + /** + * Get max date value 9999-12-31. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMaxDateAsync(final ServiceCallback serviceCallback); + + /** + * Get max date value 9999-12-31. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable getMaxDateAsync(); + + /** + * Get max date value 9999-12-31. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable> getMaxDateWithServiceResponseAsync(); + + /** + * Put min date value 0000-01-01. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putMinDate(LocalDate dateBody); + + /** + * Put min date value 0000-01-01. + * + * @param dateBody the LocalDate value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putMinDateAsync(LocalDate dateBody, final ServiceCallback serviceCallback); + + /** + * Put min date value 0000-01-01. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putMinDateAsync(LocalDate dateBody); + + /** + * Put min date value 0000-01-01. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putMinDateWithServiceResponseAsync(LocalDate dateBody); + + /** + * Get min date value 0000-01-01. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + LocalDate getMinDate(); + + /** + * Get min date value 0000-01-01. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMinDateAsync(final ServiceCallback serviceCallback); + + /** + * Get min date value 0000-01-01. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable getMinDateAsync(); + + /** + * Get min date value 0000-01-01. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + Observable> getMinDateWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydate/implementation/AutoRestDateTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodydate/implementation/AutoRestDateTestServiceImpl.java new file mode 100644 index 0000000000..dc544ee735 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/implementation/AutoRestDateTestServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydate.implementation; + +import fixtures.bodydate.AutoRestDateTestService; +import fixtures.bodydate.Dates; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestDateTestService class. + */ +public class AutoRestDateTestServiceImpl extends ServiceClient implements AutoRestDateTestService { + + /** + * The Dates object to access its operations. + */ + private Dates dates; + + /** + * Gets the Dates object to access its operations. + * @return the Dates object. + */ + public Dates dates() { + return this.dates; + } + + /** + * Initializes an instance of AutoRestDateTestService client. + */ + public AutoRestDateTestServiceImpl() { + this("https://localhost"); + } + + /** + * Initializes an instance of AutoRestDateTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestDateTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestDateTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestDateTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("https://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestDateTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestDateTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestDateTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestDateTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.dates = new DatesImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodydate/implementation/DatesImpl.java b/test/vanilla/src/main/java/fixtures/bodydate/implementation/DatesImpl.java new file mode 100644 index 0000000000..284c18bc2e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/implementation/DatesImpl.java @@ -0,0 +1,631 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydate.implementation; + +import retrofit2.Retrofit; +import fixtures.bodydate.Dates; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodydate.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import org.joda.time.LocalDate; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Dates. + */ +public class DatesImpl implements Dates { + /** The Retrofit service to perform REST calls. */ + private DatesService service; + /** The service client containing this operation class. */ + private AutoRestDateTestServiceImpl client; + + /** + * Initializes an instance of Dates. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatesImpl(Retrofit retrofit, AutoRestDateTestServiceImpl client) { + this.service = retrofit.create(DatesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Dates to be + * used by Retrofit to perform actually REST calls. + */ + interface DatesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydate.Dates getNull" }) + @GET("date/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydate.Dates getInvalidDate" }) + @GET("date/invaliddate") + Observable> getInvalidDate(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydate.Dates getOverflowDate" }) + @GET("date/overflowdate") + Observable> getOverflowDate(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydate.Dates getUnderflowDate" }) + @GET("date/underflowdate") + Observable> getUnderflowDate(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydate.Dates putMaxDate" }) + @PUT("date/max") + Observable> putMaxDate(@Body LocalDate dateBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydate.Dates getMaxDate" }) + @GET("date/max") + Observable> getMaxDate(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydate.Dates putMinDate" }) + @PUT("date/min") + Observable> putMinDate(@Body LocalDate dateBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydate.Dates getMinDate" }) + @GET("date/min") + Observable> getMinDate(); + + } + + /** + * Get null date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + public LocalDate getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null date value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, LocalDate>() { + @Override + public LocalDate call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + public LocalDate getInvalidDate() { + return getInvalidDateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid date value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidDateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidDateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable getInvalidDateAsync() { + return getInvalidDateWithServiceResponseAsync().map(new Func1, LocalDate>() { + @Override + public LocalDate call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable> getInvalidDateWithServiceResponseAsync() { + return service.getInvalidDate() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDateDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get overflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + public LocalDate getOverflowDate() { + return getOverflowDateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get overflow date value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOverflowDateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOverflowDateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get overflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable getOverflowDateAsync() { + return getOverflowDateWithServiceResponseAsync().map(new Func1, LocalDate>() { + @Override + public LocalDate call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get overflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable> getOverflowDateWithServiceResponseAsync() { + return service.getOverflowDate() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getOverflowDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOverflowDateDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get underflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + public LocalDate getUnderflowDate() { + return getUnderflowDateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get underflow date value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUnderflowDateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUnderflowDateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get underflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable getUnderflowDateAsync() { + return getUnderflowDateWithServiceResponseAsync().map(new Func1, LocalDate>() { + @Override + public LocalDate call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get underflow date value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable> getUnderflowDateWithServiceResponseAsync() { + return service.getUnderflowDate() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUnderflowDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUnderflowDateDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put max date value 9999-12-31. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putMaxDate(LocalDate dateBody) { + putMaxDateWithServiceResponseAsync(dateBody).toBlocking().single().body(); + } + + /** + * Put max date value 9999-12-31. + * + * @param dateBody the LocalDate value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putMaxDateAsync(LocalDate dateBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putMaxDateWithServiceResponseAsync(dateBody), serviceCallback); + } + + /** + * Put max date value 9999-12-31. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putMaxDateAsync(LocalDate dateBody) { + return putMaxDateWithServiceResponseAsync(dateBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put max date value 9999-12-31. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putMaxDateWithServiceResponseAsync(LocalDate dateBody) { + if (dateBody == null) { + throw new IllegalArgumentException("Parameter dateBody is required and cannot be null."); + } + return service.putMaxDate(dateBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putMaxDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putMaxDateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max date value 9999-12-31. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + public LocalDate getMaxDate() { + return getMaxDateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max date value 9999-12-31. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMaxDateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMaxDateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max date value 9999-12-31. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable getMaxDateAsync() { + return getMaxDateWithServiceResponseAsync().map(new Func1, LocalDate>() { + @Override + public LocalDate call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max date value 9999-12-31. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable> getMaxDateWithServiceResponseAsync() { + return service.getMaxDate() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMaxDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMaxDateDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put min date value 0000-01-01. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putMinDate(LocalDate dateBody) { + putMinDateWithServiceResponseAsync(dateBody).toBlocking().single().body(); + } + + /** + * Put min date value 0000-01-01. + * + * @param dateBody the LocalDate value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putMinDateAsync(LocalDate dateBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putMinDateWithServiceResponseAsync(dateBody), serviceCallback); + } + + /** + * Put min date value 0000-01-01. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putMinDateAsync(LocalDate dateBody) { + return putMinDateWithServiceResponseAsync(dateBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put min date value 0000-01-01. + * + * @param dateBody the LocalDate value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putMinDateWithServiceResponseAsync(LocalDate dateBody) { + if (dateBody == null) { + throw new IllegalArgumentException("Parameter dateBody is required and cannot be null."); + } + return service.putMinDate(dateBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putMinDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putMinDateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get min date value 0000-01-01. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LocalDate object if successful. + */ + public LocalDate getMinDate() { + return getMinDateWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get min date value 0000-01-01. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMinDateAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMinDateWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get min date value 0000-01-01. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable getMinDateAsync() { + return getMinDateWithServiceResponseAsync().map(new Func1, LocalDate>() { + @Override + public LocalDate call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get min date value 0000-01-01. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LocalDate object + */ + public Observable> getMinDateWithServiceResponseAsync() { + return service.getMinDate() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMinDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMinDateDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydate/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodydate/implementation/package-info.java new file mode 100644 index 0000000000..1f4f9897a6 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestDateTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydate.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodydate/models/Error.java b/test/vanilla/src/main/java/fixtures/bodydate/models/Error.java new file mode 100644 index 0000000000..bb5a98a9b6 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydate.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydate/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodydate/models/ErrorException.java new file mode 100644 index 0000000000..e287202728 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydate.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodydate/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodydate/models/package-info.java new file mode 100644 index 0000000000..3010804092 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestDateTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydate.models; diff --git a/test/vanilla/src/main/java/fixtures/bodydate/package-info.java b/test/vanilla/src/main/java/fixtures/bodydate/package-info.java new file mode 100644 index 0000000000..b43824dfd0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydate/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestDateTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydate; diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/AutoRestDateTimeTestService.java b/test/vanilla/src/main/java/fixtures/bodydatetime/AutoRestDateTimeTestService.java new file mode 100644 index 0000000000..fa7bf0b831 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/AutoRestDateTimeTestService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetime; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestDateTimeTestService class. + */ +public interface AutoRestDateTimeTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "https://localhost"; + + /** + * Gets the Datetimes object to access its operations. + * @return the Datetimes object. + */ + Datetimes datetimes(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/Datetimes.java b/test/vanilla/src/main/java/fixtures/bodydatetime/Datetimes.java new file mode 100644 index 0000000000..dd385c8694 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/Datetimes.java @@ -0,0 +1,709 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetime; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodydatetime.models.ErrorException; +import java.io.IOException; +import org.joda.time.DateTime; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Datetimes. + */ +public interface Datetimes { + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getNull(); + + /** + * Get null datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getNullAsync(); + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getInvalid(); + + /** + * Get invalid datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getInvalidAsync(); + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getInvalidWithServiceResponseAsync(); + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getOverflow(); + + /** + * Get overflow datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getOverflowAsync(final ServiceCallback serviceCallback); + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getOverflowAsync(); + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getOverflowWithServiceResponseAsync(); + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUnderflow(); + + /** + * Get underflow datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUnderflowAsync(final ServiceCallback serviceCallback); + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUnderflowAsync(); + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUnderflowWithServiceResponseAsync(); + + /** + * Put max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putUtcMaxDateTime(DateTime datetimeBody); + + /** + * Put max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putUtcMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback); + + /** + * Put max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putUtcMaxDateTimeAsync(DateTime datetimeBody); + + /** + * Put max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putUtcMaxDateTimeWithServiceResponseAsync(DateTime datetimeBody); + + /** + * Get max datetime value 9999-12-31t23:59:59.9999999z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUtcLowercaseMaxDateTime(); + + /** + * Get max datetime value 9999-12-31t23:59:59.9999999z. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUtcLowercaseMaxDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get max datetime value 9999-12-31t23:59:59.9999999z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUtcLowercaseMaxDateTimeAsync(); + + /** + * Get max datetime value 9999-12-31t23:59:59.9999999z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUtcLowercaseMaxDateTimeWithServiceResponseAsync(); + + /** + * Get max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUtcUppercaseMaxDateTime(); + + /** + * Get max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUtcUppercaseMaxDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUtcUppercaseMaxDateTimeAsync(); + + /** + * Get max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUtcUppercaseMaxDateTimeWithServiceResponseAsync(); + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putLocalPositiveOffsetMaxDateTime(DateTime datetimeBody); + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putLocalPositiveOffsetMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback); + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putLocalPositiveOffsetMaxDateTimeAsync(DateTime datetimeBody); + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putLocalPositiveOffsetMaxDateTimeWithServiceResponseAsync(DateTime datetimeBody); + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getLocalPositiveOffsetLowercaseMaxDateTime(); + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLocalPositiveOffsetLowercaseMaxDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getLocalPositiveOffsetLowercaseMaxDateTimeAsync(); + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getLocalPositiveOffsetLowercaseMaxDateTimeWithServiceResponseAsync(); + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getLocalPositiveOffsetUppercaseMaxDateTime(); + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLocalPositiveOffsetUppercaseMaxDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getLocalPositiveOffsetUppercaseMaxDateTimeAsync(); + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getLocalPositiveOffsetUppercaseMaxDateTimeWithServiceResponseAsync(); + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putLocalNegativeOffsetMaxDateTime(DateTime datetimeBody); + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putLocalNegativeOffsetMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback); + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putLocalNegativeOffsetMaxDateTimeAsync(DateTime datetimeBody); + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putLocalNegativeOffsetMaxDateTimeWithServiceResponseAsync(DateTime datetimeBody); + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getLocalNegativeOffsetUppercaseMaxDateTime(); + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLocalNegativeOffsetUppercaseMaxDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getLocalNegativeOffsetUppercaseMaxDateTimeAsync(); + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getLocalNegativeOffsetUppercaseMaxDateTimeWithServiceResponseAsync(); + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getLocalNegativeOffsetLowercaseMaxDateTime(); + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLocalNegativeOffsetLowercaseMaxDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getLocalNegativeOffsetLowercaseMaxDateTimeAsync(); + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getLocalNegativeOffsetLowercaseMaxDateTimeWithServiceResponseAsync(); + + /** + * Put min datetime value 0001-01-01T00:00:00Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putUtcMinDateTime(DateTime datetimeBody); + + /** + * Put min datetime value 0001-01-01T00:00:00Z. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putUtcMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback); + + /** + * Put min datetime value 0001-01-01T00:00:00Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putUtcMinDateTimeAsync(DateTime datetimeBody); + + /** + * Put min datetime value 0001-01-01T00:00:00Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putUtcMinDateTimeWithServiceResponseAsync(DateTime datetimeBody); + + /** + * Get min datetime value 0001-01-01T00:00:00Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUtcMinDateTime(); + + /** + * Get min datetime value 0001-01-01T00:00:00Z. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUtcMinDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get min datetime value 0001-01-01T00:00:00Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUtcMinDateTimeAsync(); + + /** + * Get min datetime value 0001-01-01T00:00:00Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUtcMinDateTimeWithServiceResponseAsync(); + + /** + * Put min datetime value 0001-01-01T00:00:00+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putLocalPositiveOffsetMinDateTime(DateTime datetimeBody); + + /** + * Put min datetime value 0001-01-01T00:00:00+14:00. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putLocalPositiveOffsetMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback); + + /** + * Put min datetime value 0001-01-01T00:00:00+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putLocalPositiveOffsetMinDateTimeAsync(DateTime datetimeBody); + + /** + * Put min datetime value 0001-01-01T00:00:00+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putLocalPositiveOffsetMinDateTimeWithServiceResponseAsync(DateTime datetimeBody); + + /** + * Get min datetime value 0001-01-01T00:00:00+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getLocalPositiveOffsetMinDateTime(); + + /** + * Get min datetime value 0001-01-01T00:00:00+14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLocalPositiveOffsetMinDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get min datetime value 0001-01-01T00:00:00+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getLocalPositiveOffsetMinDateTimeAsync(); + + /** + * Get min datetime value 0001-01-01T00:00:00+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getLocalPositiveOffsetMinDateTimeWithServiceResponseAsync(); + + /** + * Put min datetime value 0001-01-01T00:00:00-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putLocalNegativeOffsetMinDateTime(DateTime datetimeBody); + + /** + * Put min datetime value 0001-01-01T00:00:00-14:00. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putLocalNegativeOffsetMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback); + + /** + * Put min datetime value 0001-01-01T00:00:00-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putLocalNegativeOffsetMinDateTimeAsync(DateTime datetimeBody); + + /** + * Put min datetime value 0001-01-01T00:00:00-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putLocalNegativeOffsetMinDateTimeWithServiceResponseAsync(DateTime datetimeBody); + + /** + * Get min datetime value 0001-01-01T00:00:00-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getLocalNegativeOffsetMinDateTime(); + + /** + * Get min datetime value 0001-01-01T00:00:00-14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLocalNegativeOffsetMinDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get min datetime value 0001-01-01T00:00:00-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getLocalNegativeOffsetMinDateTimeAsync(); + + /** + * Get min datetime value 0001-01-01T00:00:00-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getLocalNegativeOffsetMinDateTimeWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/AutoRestDateTimeTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/AutoRestDateTimeTestServiceImpl.java new file mode 100644 index 0000000000..dbd471ba93 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/AutoRestDateTimeTestServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetime.implementation; + +import fixtures.bodydatetime.AutoRestDateTimeTestService; +import fixtures.bodydatetime.Datetimes; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestDateTimeTestService class. + */ +public class AutoRestDateTimeTestServiceImpl extends ServiceClient implements AutoRestDateTimeTestService { + + /** + * The Datetimes object to access its operations. + */ + private Datetimes datetimes; + + /** + * Gets the Datetimes object to access its operations. + * @return the Datetimes object. + */ + public Datetimes datetimes() { + return this.datetimes; + } + + /** + * Initializes an instance of AutoRestDateTimeTestService client. + */ + public AutoRestDateTimeTestServiceImpl() { + this("https://localhost"); + } + + /** + * Initializes an instance of AutoRestDateTimeTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestDateTimeTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestDateTimeTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestDateTimeTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("https://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestDateTimeTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestDateTimeTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestDateTimeTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestDateTimeTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.datetimes = new DatetimesImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/DatetimesImpl.java b/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/DatetimesImpl.java new file mode 100644 index 0000000000..c7eeac9a1c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/DatetimesImpl.java @@ -0,0 +1,1425 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetime.implementation; + +import retrofit2.Retrofit; +import fixtures.bodydatetime.Datetimes; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodydatetime.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import org.joda.time.DateTime; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Datetimes. + */ +public class DatetimesImpl implements Datetimes { + /** The Retrofit service to perform REST calls. */ + private DatetimesService service; + /** The service client containing this operation class. */ + private AutoRestDateTimeTestServiceImpl client; + + /** + * Initializes an instance of Datetimes. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DatetimesImpl(Retrofit retrofit, AutoRestDateTimeTestServiceImpl client) { + this.service = retrofit.create(DatetimesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Datetimes to be + * used by Retrofit to perform actually REST calls. + */ + interface DatetimesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getNull" }) + @GET("datetime/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getInvalid" }) + @GET("datetime/invalid") + Observable> getInvalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getOverflow" }) + @GET("datetime/overflow") + Observable> getOverflow(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getUnderflow" }) + @GET("datetime/underflow") + Observable> getUnderflow(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes putUtcMaxDateTime" }) + @PUT("datetime/max/utc") + Observable> putUtcMaxDateTime(@Body DateTime datetimeBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getUtcLowercaseMaxDateTime" }) + @GET("datetime/max/utc/lowercase") + Observable> getUtcLowercaseMaxDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getUtcUppercaseMaxDateTime" }) + @GET("datetime/max/utc/uppercase") + Observable> getUtcUppercaseMaxDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes putLocalPositiveOffsetMaxDateTime" }) + @PUT("datetime/max/localpositiveoffset") + Observable> putLocalPositiveOffsetMaxDateTime(@Body DateTime datetimeBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getLocalPositiveOffsetLowercaseMaxDateTime" }) + @GET("datetime/max/localpositiveoffset/lowercase") + Observable> getLocalPositiveOffsetLowercaseMaxDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getLocalPositiveOffsetUppercaseMaxDateTime" }) + @GET("datetime/max/localpositiveoffset/uppercase") + Observable> getLocalPositiveOffsetUppercaseMaxDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes putLocalNegativeOffsetMaxDateTime" }) + @PUT("datetime/max/localnegativeoffset") + Observable> putLocalNegativeOffsetMaxDateTime(@Body DateTime datetimeBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getLocalNegativeOffsetUppercaseMaxDateTime" }) + @GET("datetime/max/localnegativeoffset/uppercase") + Observable> getLocalNegativeOffsetUppercaseMaxDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getLocalNegativeOffsetLowercaseMaxDateTime" }) + @GET("datetime/max/localnegativeoffset/lowercase") + Observable> getLocalNegativeOffsetLowercaseMaxDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes putUtcMinDateTime" }) + @PUT("datetime/min/utc") + Observable> putUtcMinDateTime(@Body DateTime datetimeBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getUtcMinDateTime" }) + @GET("datetime/min/utc") + Observable> getUtcMinDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes putLocalPositiveOffsetMinDateTime" }) + @PUT("datetime/min/localpositiveoffset") + Observable> putLocalPositiveOffsetMinDateTime(@Body DateTime datetimeBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getLocalPositiveOffsetMinDateTime" }) + @GET("datetime/min/localpositiveoffset") + Observable> getLocalPositiveOffsetMinDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes putLocalNegativeOffsetMinDateTime" }) + @PUT("datetime/min/localnegativeoffset") + Observable> putLocalNegativeOffsetMinDateTime(@Body DateTime datetimeBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetime.Datetimes getLocalNegativeOffsetMinDateTime" }) + @GET("datetime/min/localnegativeoffset") + Observable> getLocalNegativeOffsetMinDateTime(); + + } + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getOverflow() { + return getOverflowWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get overflow datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOverflowAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOverflowWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getOverflowAsync() { + return getOverflowWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getOverflowWithServiceResponseAsync() { + return service.getOverflow() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getOverflowDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOverflowDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUnderflow() { + return getUnderflowWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get underflow datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUnderflowAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUnderflowWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUnderflowAsync() { + return getUnderflowWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUnderflowWithServiceResponseAsync() { + return service.getUnderflow() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUnderflowDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUnderflowDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putUtcMaxDateTime(DateTime datetimeBody) { + putUtcMaxDateTimeWithServiceResponseAsync(datetimeBody).toBlocking().single().body(); + } + + /** + * Put max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putUtcMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putUtcMaxDateTimeWithServiceResponseAsync(datetimeBody), serviceCallback); + } + + /** + * Put max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putUtcMaxDateTimeAsync(DateTime datetimeBody) { + return putUtcMaxDateTimeWithServiceResponseAsync(datetimeBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putUtcMaxDateTimeWithServiceResponseAsync(DateTime datetimeBody) { + if (datetimeBody == null) { + throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); + } + return service.putUtcMaxDateTime(datetimeBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putUtcMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putUtcMaxDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max datetime value 9999-12-31t23:59:59.9999999z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUtcLowercaseMaxDateTime() { + return getUtcLowercaseMaxDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max datetime value 9999-12-31t23:59:59.9999999z. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUtcLowercaseMaxDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUtcLowercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max datetime value 9999-12-31t23:59:59.9999999z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUtcLowercaseMaxDateTimeAsync() { + return getUtcLowercaseMaxDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max datetime value 9999-12-31t23:59:59.9999999z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUtcLowercaseMaxDateTimeWithServiceResponseAsync() { + return service.getUtcLowercaseMaxDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUtcLowercaseMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUtcLowercaseMaxDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUtcUppercaseMaxDateTime() { + return getUtcUppercaseMaxDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUtcUppercaseMaxDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUtcUppercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUtcUppercaseMaxDateTimeAsync() { + return getUtcUppercaseMaxDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max datetime value 9999-12-31T23:59:59.9999999Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUtcUppercaseMaxDateTimeWithServiceResponseAsync() { + return service.getUtcUppercaseMaxDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUtcUppercaseMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUtcUppercaseMaxDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putLocalPositiveOffsetMaxDateTime(DateTime datetimeBody) { + putLocalPositiveOffsetMaxDateTimeWithServiceResponseAsync(datetimeBody).toBlocking().single().body(); + } + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putLocalPositiveOffsetMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putLocalPositiveOffsetMaxDateTimeWithServiceResponseAsync(datetimeBody), serviceCallback); + } + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putLocalPositiveOffsetMaxDateTimeAsync(DateTime datetimeBody) { + return putLocalPositiveOffsetMaxDateTimeWithServiceResponseAsync(datetimeBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putLocalPositiveOffsetMaxDateTimeWithServiceResponseAsync(DateTime datetimeBody) { + if (datetimeBody == null) { + throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); + } + return service.putLocalPositiveOffsetMaxDateTime(datetimeBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putLocalPositiveOffsetMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putLocalPositiveOffsetMaxDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getLocalPositiveOffsetLowercaseMaxDateTime() { + return getLocalPositiveOffsetLowercaseMaxDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLocalPositiveOffsetLowercaseMaxDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLocalPositiveOffsetLowercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getLocalPositiveOffsetLowercaseMaxDateTimeAsync() { + return getLocalPositiveOffsetLowercaseMaxDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getLocalPositiveOffsetLowercaseMaxDateTimeWithServiceResponseAsync() { + return service.getLocalPositiveOffsetLowercaseMaxDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLocalPositiveOffsetLowercaseMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLocalPositiveOffsetLowercaseMaxDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getLocalPositiveOffsetUppercaseMaxDateTime() { + return getLocalPositiveOffsetUppercaseMaxDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLocalPositiveOffsetUppercaseMaxDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLocalPositiveOffsetUppercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getLocalPositiveOffsetUppercaseMaxDateTimeAsync() { + return getLocalPositiveOffsetUppercaseMaxDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getLocalPositiveOffsetUppercaseMaxDateTimeWithServiceResponseAsync() { + return service.getLocalPositiveOffsetUppercaseMaxDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLocalPositiveOffsetUppercaseMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLocalPositiveOffsetUppercaseMaxDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putLocalNegativeOffsetMaxDateTime(DateTime datetimeBody) { + putLocalNegativeOffsetMaxDateTimeWithServiceResponseAsync(datetimeBody).toBlocking().single().body(); + } + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putLocalNegativeOffsetMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putLocalNegativeOffsetMaxDateTimeWithServiceResponseAsync(datetimeBody), serviceCallback); + } + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putLocalNegativeOffsetMaxDateTimeAsync(DateTime datetimeBody) { + return putLocalNegativeOffsetMaxDateTimeWithServiceResponseAsync(datetimeBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put max datetime value with positive numoffset 9999-12-31t23:59:59.9999999-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putLocalNegativeOffsetMaxDateTimeWithServiceResponseAsync(DateTime datetimeBody) { + if (datetimeBody == null) { + throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); + } + return service.putLocalNegativeOffsetMaxDateTime(datetimeBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putLocalNegativeOffsetMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putLocalNegativeOffsetMaxDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getLocalNegativeOffsetUppercaseMaxDateTime() { + return getLocalNegativeOffsetUppercaseMaxDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLocalNegativeOffsetUppercaseMaxDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLocalNegativeOffsetUppercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getLocalNegativeOffsetUppercaseMaxDateTimeAsync() { + return getLocalNegativeOffsetUppercaseMaxDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max datetime value with positive num offset 9999-12-31T23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getLocalNegativeOffsetUppercaseMaxDateTimeWithServiceResponseAsync() { + return service.getLocalNegativeOffsetUppercaseMaxDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLocalNegativeOffsetUppercaseMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLocalNegativeOffsetUppercaseMaxDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getLocalNegativeOffsetLowercaseMaxDateTime() { + return getLocalNegativeOffsetLowercaseMaxDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLocalNegativeOffsetLowercaseMaxDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLocalNegativeOffsetLowercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getLocalNegativeOffsetLowercaseMaxDateTimeAsync() { + return getLocalNegativeOffsetLowercaseMaxDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getLocalNegativeOffsetLowercaseMaxDateTimeWithServiceResponseAsync() { + return service.getLocalNegativeOffsetLowercaseMaxDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLocalNegativeOffsetLowercaseMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLocalNegativeOffsetLowercaseMaxDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put min datetime value 0001-01-01T00:00:00Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putUtcMinDateTime(DateTime datetimeBody) { + putUtcMinDateTimeWithServiceResponseAsync(datetimeBody).toBlocking().single().body(); + } + + /** + * Put min datetime value 0001-01-01T00:00:00Z. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putUtcMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putUtcMinDateTimeWithServiceResponseAsync(datetimeBody), serviceCallback); + } + + /** + * Put min datetime value 0001-01-01T00:00:00Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putUtcMinDateTimeAsync(DateTime datetimeBody) { + return putUtcMinDateTimeWithServiceResponseAsync(datetimeBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put min datetime value 0001-01-01T00:00:00Z. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putUtcMinDateTimeWithServiceResponseAsync(DateTime datetimeBody) { + if (datetimeBody == null) { + throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); + } + return service.putUtcMinDateTime(datetimeBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putUtcMinDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putUtcMinDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get min datetime value 0001-01-01T00:00:00Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUtcMinDateTime() { + return getUtcMinDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get min datetime value 0001-01-01T00:00:00Z. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUtcMinDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUtcMinDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get min datetime value 0001-01-01T00:00:00Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUtcMinDateTimeAsync() { + return getUtcMinDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get min datetime value 0001-01-01T00:00:00Z. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUtcMinDateTimeWithServiceResponseAsync() { + return service.getUtcMinDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUtcMinDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUtcMinDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put min datetime value 0001-01-01T00:00:00+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putLocalPositiveOffsetMinDateTime(DateTime datetimeBody) { + putLocalPositiveOffsetMinDateTimeWithServiceResponseAsync(datetimeBody).toBlocking().single().body(); + } + + /** + * Put min datetime value 0001-01-01T00:00:00+14:00. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putLocalPositiveOffsetMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putLocalPositiveOffsetMinDateTimeWithServiceResponseAsync(datetimeBody), serviceCallback); + } + + /** + * Put min datetime value 0001-01-01T00:00:00+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putLocalPositiveOffsetMinDateTimeAsync(DateTime datetimeBody) { + return putLocalPositiveOffsetMinDateTimeWithServiceResponseAsync(datetimeBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put min datetime value 0001-01-01T00:00:00+14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putLocalPositiveOffsetMinDateTimeWithServiceResponseAsync(DateTime datetimeBody) { + if (datetimeBody == null) { + throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); + } + return service.putLocalPositiveOffsetMinDateTime(datetimeBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putLocalPositiveOffsetMinDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putLocalPositiveOffsetMinDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get min datetime value 0001-01-01T00:00:00+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getLocalPositiveOffsetMinDateTime() { + return getLocalPositiveOffsetMinDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get min datetime value 0001-01-01T00:00:00+14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLocalPositiveOffsetMinDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLocalPositiveOffsetMinDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get min datetime value 0001-01-01T00:00:00+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getLocalPositiveOffsetMinDateTimeAsync() { + return getLocalPositiveOffsetMinDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get min datetime value 0001-01-01T00:00:00+14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getLocalPositiveOffsetMinDateTimeWithServiceResponseAsync() { + return service.getLocalPositiveOffsetMinDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLocalPositiveOffsetMinDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLocalPositiveOffsetMinDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put min datetime value 0001-01-01T00:00:00-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putLocalNegativeOffsetMinDateTime(DateTime datetimeBody) { + putLocalNegativeOffsetMinDateTimeWithServiceResponseAsync(datetimeBody).toBlocking().single().body(); + } + + /** + * Put min datetime value 0001-01-01T00:00:00-14:00. + * + * @param datetimeBody the DateTime value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putLocalNegativeOffsetMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putLocalNegativeOffsetMinDateTimeWithServiceResponseAsync(datetimeBody), serviceCallback); + } + + /** + * Put min datetime value 0001-01-01T00:00:00-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putLocalNegativeOffsetMinDateTimeAsync(DateTime datetimeBody) { + return putLocalNegativeOffsetMinDateTimeWithServiceResponseAsync(datetimeBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put min datetime value 0001-01-01T00:00:00-14:00. + * + * @param datetimeBody the DateTime value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putLocalNegativeOffsetMinDateTimeWithServiceResponseAsync(DateTime datetimeBody) { + if (datetimeBody == null) { + throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); + } + return service.putLocalNegativeOffsetMinDateTime(datetimeBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putLocalNegativeOffsetMinDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putLocalNegativeOffsetMinDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get min datetime value 0001-01-01T00:00:00-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getLocalNegativeOffsetMinDateTime() { + return getLocalNegativeOffsetMinDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get min datetime value 0001-01-01T00:00:00-14:00. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLocalNegativeOffsetMinDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLocalNegativeOffsetMinDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get min datetime value 0001-01-01T00:00:00-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getLocalNegativeOffsetMinDateTimeAsync() { + return getLocalNegativeOffsetMinDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get min datetime value 0001-01-01T00:00:00-14:00. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getLocalNegativeOffsetMinDateTimeWithServiceResponseAsync() { + return service.getLocalNegativeOffsetMinDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLocalNegativeOffsetMinDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLocalNegativeOffsetMinDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/package-info.java new file mode 100644 index 0000000000..f7651101a7 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestDateTimeTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydatetime.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/models/Error.java b/test/vanilla/src/main/java/fixtures/bodydatetime/models/Error.java new file mode 100644 index 0000000000..7a9a8579d5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetime.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodydatetime/models/ErrorException.java new file mode 100644 index 0000000000..ed12040b5a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetime.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodydatetime/models/package-info.java new file mode 100644 index 0000000000..ef150361f7 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestDateTimeTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydatetime.models; diff --git a/test/vanilla/src/main/java/fixtures/bodydatetime/package-info.java b/test/vanilla/src/main/java/fixtures/bodydatetime/package-info.java new file mode 100644 index 0000000000..49d1aaf764 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetime/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestDateTimeTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydatetime; diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/AutoRestRFC1123DateTimeTestService.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/AutoRestRFC1123DateTimeTestService.java new file mode 100644 index 0000000000..5f1298563e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/AutoRestRFC1123DateTimeTestService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetimerfc1123; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestRFC1123DateTimeTestService class. + */ +public interface AutoRestRFC1123DateTimeTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "https://localhost"; + + /** + * Gets the Datetimerfc1123s object to access its operations. + * @return the Datetimerfc1123s object. + */ + Datetimerfc1123s datetimerfc1123s(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java new file mode 100644 index 0000000000..62a91c401d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/Datetimerfc1123s.java @@ -0,0 +1,347 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetimerfc1123; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodydatetimerfc1123.models.ErrorException; +import java.io.IOException; +import org.joda.time.DateTime; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Datetimerfc1123s. + */ +public interface Datetimerfc1123s { + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getNull(); + + /** + * Get null datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getNullAsync(); + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getInvalid(); + + /** + * Get invalid datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getInvalidAsync(); + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getInvalidWithServiceResponseAsync(); + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getOverflow(); + + /** + * Get overflow datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getOverflowAsync(final ServiceCallback serviceCallback); + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getOverflowAsync(); + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getOverflowWithServiceResponseAsync(); + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUnderflow(); + + /** + * Get underflow datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUnderflowAsync(final ServiceCallback serviceCallback); + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUnderflowAsync(); + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUnderflowWithServiceResponseAsync(); + + /** + * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putUtcMaxDateTime(DateTime datetimeBody); + + /** + * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putUtcMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback); + + /** + * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putUtcMaxDateTimeAsync(DateTime datetimeBody); + + /** + * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putUtcMaxDateTimeWithServiceResponseAsync(DateTime datetimeBody); + + /** + * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUtcLowercaseMaxDateTime(); + + /** + * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUtcLowercaseMaxDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUtcLowercaseMaxDateTimeAsync(); + + /** + * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUtcLowercaseMaxDateTimeWithServiceResponseAsync(); + + /** + * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUtcUppercaseMaxDateTime(); + + /** + * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUtcUppercaseMaxDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUtcUppercaseMaxDateTimeAsync(); + + /** + * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUtcUppercaseMaxDateTimeWithServiceResponseAsync(); + + /** + * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putUtcMinDateTime(DateTime datetimeBody); + + /** + * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putUtcMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback); + + /** + * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putUtcMinDateTimeAsync(DateTime datetimeBody); + + /** + * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putUtcMinDateTimeWithServiceResponseAsync(DateTime datetimeBody); + + /** + * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUtcMinDateTime(); + + /** + * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUtcMinDateTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUtcMinDateTimeAsync(); + + /** + * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUtcMinDateTimeWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/AutoRestRFC1123DateTimeTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/AutoRestRFC1123DateTimeTestServiceImpl.java new file mode 100644 index 0000000000..5c80fcc95d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/AutoRestRFC1123DateTimeTestServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetimerfc1123.implementation; + +import fixtures.bodydatetimerfc1123.AutoRestRFC1123DateTimeTestService; +import fixtures.bodydatetimerfc1123.Datetimerfc1123s; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestRFC1123DateTimeTestService class. + */ +public class AutoRestRFC1123DateTimeTestServiceImpl extends ServiceClient implements AutoRestRFC1123DateTimeTestService { + + /** + * The Datetimerfc1123s object to access its operations. + */ + private Datetimerfc1123s datetimerfc1123s; + + /** + * Gets the Datetimerfc1123s object to access its operations. + * @return the Datetimerfc1123s object. + */ + public Datetimerfc1123s datetimerfc1123s() { + return this.datetimerfc1123s; + } + + /** + * Initializes an instance of AutoRestRFC1123DateTimeTestService client. + */ + public AutoRestRFC1123DateTimeTestServiceImpl() { + this("https://localhost"); + } + + /** + * Initializes an instance of AutoRestRFC1123DateTimeTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestRFC1123DateTimeTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestRFC1123DateTimeTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestRFC1123DateTimeTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("https://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestRFC1123DateTimeTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestRFC1123DateTimeTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestRFC1123DateTimeTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestRFC1123DateTimeTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.datetimerfc1123s = new Datetimerfc1123sImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/Datetimerfc1123sImpl.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/Datetimerfc1123sImpl.java new file mode 100644 index 0000000000..aad1300fe1 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/Datetimerfc1123sImpl.java @@ -0,0 +1,739 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetimerfc1123.implementation; + +import retrofit2.Retrofit; +import fixtures.bodydatetimerfc1123.Datetimerfc1123s; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.DateTimeRfc1123; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodydatetimerfc1123.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import org.joda.time.DateTime; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Datetimerfc1123s. + */ +public class Datetimerfc1123sImpl implements Datetimerfc1123s { + /** The Retrofit service to perform REST calls. */ + private Datetimerfc1123sService service; + /** The service client containing this operation class. */ + private AutoRestRFC1123DateTimeTestServiceImpl client; + + /** + * Initializes an instance of Datetimerfc1123s. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public Datetimerfc1123sImpl(Retrofit retrofit, AutoRestRFC1123DateTimeTestServiceImpl client) { + this.service = retrofit.create(Datetimerfc1123sService.class); + this.client = client; + } + + /** + * The interface defining all the services for Datetimerfc1123s to be + * used by Retrofit to perform actually REST calls. + */ + interface Datetimerfc1123sService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s getNull" }) + @GET("datetimerfc1123/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s getInvalid" }) + @GET("datetimerfc1123/invalid") + Observable> getInvalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s getOverflow" }) + @GET("datetimerfc1123/overflow") + Observable> getOverflow(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s getUnderflow" }) + @GET("datetimerfc1123/underflow") + Observable> getUnderflow(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s putUtcMaxDateTime" }) + @PUT("datetimerfc1123/max") + Observable> putUtcMaxDateTime(@Body DateTimeRfc1123 datetimeBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s getUtcLowercaseMaxDateTime" }) + @GET("datetimerfc1123/max/lowercase") + Observable> getUtcLowercaseMaxDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s getUtcUppercaseMaxDateTime" }) + @GET("datetimerfc1123/max/uppercase") + Observable> getUtcUppercaseMaxDateTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s putUtcMinDateTime" }) + @PUT("datetimerfc1123/min") + Observable> putUtcMinDateTime(@Body DateTimeRfc1123 datetimeBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydatetimerfc1123.Datetimerfc1123s getUtcMinDateTime" }) + @GET("datetimerfc1123/min") + Observable> getUtcMinDateTime(); + + } + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getNullDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = result.body().dateTime(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getInvalidDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = result.body().dateTime(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getOverflow() { + return getOverflowWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get overflow datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOverflowAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOverflowWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getOverflowAsync() { + return getOverflowWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get overflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getOverflowWithServiceResponseAsync() { + return service.getOverflow() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getOverflowDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = result.body().dateTime(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOverflowDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUnderflow() { + return getUnderflowWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get underflow datetime value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUnderflowAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUnderflowWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUnderflowAsync() { + return getUnderflowWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get underflow datetime value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUnderflowWithServiceResponseAsync() { + return service.getUnderflow() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getUnderflowDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = result.body().dateTime(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUnderflowDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putUtcMaxDateTime(DateTime datetimeBody) { + putUtcMaxDateTimeWithServiceResponseAsync(datetimeBody).toBlocking().single().body(); + } + + /** + * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putUtcMaxDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putUtcMaxDateTimeWithServiceResponseAsync(datetimeBody), serviceCallback); + } + + /** + * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putUtcMaxDateTimeAsync(DateTime datetimeBody) { + return putUtcMaxDateTimeWithServiceResponseAsync(datetimeBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put max datetime value Fri, 31 Dec 9999 23:59:59 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putUtcMaxDateTimeWithServiceResponseAsync(DateTime datetimeBody) { + if (datetimeBody == null) { + throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); + } + DateTimeRfc1123 datetimeBodyConverted = new DateTimeRfc1123(datetimeBody); + return service.putUtcMaxDateTime(datetimeBodyConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putUtcMaxDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putUtcMaxDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUtcLowercaseMaxDateTime() { + return getUtcLowercaseMaxDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUtcLowercaseMaxDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUtcLowercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUtcLowercaseMaxDateTimeAsync() { + return getUtcLowercaseMaxDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max datetime value fri, 31 dec 9999 23:59:59 gmt. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUtcLowercaseMaxDateTimeWithServiceResponseAsync() { + return service.getUtcLowercaseMaxDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getUtcLowercaseMaxDateTimeDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = result.body().dateTime(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUtcLowercaseMaxDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUtcUppercaseMaxDateTime() { + return getUtcUppercaseMaxDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUtcUppercaseMaxDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUtcUppercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUtcUppercaseMaxDateTimeAsync() { + return getUtcUppercaseMaxDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get max datetime value FRI, 31 DEC 9999 23:59:59 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUtcUppercaseMaxDateTimeWithServiceResponseAsync() { + return service.getUtcUppercaseMaxDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getUtcUppercaseMaxDateTimeDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = result.body().dateTime(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUtcUppercaseMaxDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putUtcMinDateTime(DateTime datetimeBody) { + putUtcMinDateTimeWithServiceResponseAsync(datetimeBody).toBlocking().single().body(); + } + + /** + * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putUtcMinDateTimeAsync(DateTime datetimeBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putUtcMinDateTimeWithServiceResponseAsync(datetimeBody), serviceCallback); + } + + /** + * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putUtcMinDateTimeAsync(DateTime datetimeBody) { + return putUtcMinDateTimeWithServiceResponseAsync(datetimeBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param datetimeBody the DateTimeRfc1123 value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putUtcMinDateTimeWithServiceResponseAsync(DateTime datetimeBody) { + if (datetimeBody == null) { + throw new IllegalArgumentException("Parameter datetimeBody is required and cannot be null."); + } + DateTimeRfc1123 datetimeBodyConverted = new DateTimeRfc1123(datetimeBody); + return service.putUtcMinDateTime(datetimeBodyConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putUtcMinDateTimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putUtcMinDateTimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUtcMinDateTime() { + return getUtcMinDateTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUtcMinDateTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUtcMinDateTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUtcMinDateTimeAsync() { + return getUtcMinDateTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get min datetime value Mon, 1 Jan 0001 00:00:00 GMT. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUtcMinDateTimeWithServiceResponseAsync() { + return service.getUtcMinDateTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getUtcMinDateTimeDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = result.body().dateTime(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUtcMinDateTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/package-info.java new file mode 100644 index 0000000000..d04b9f0ead --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestRFC1123DateTimeTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydatetimerfc1123.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/Error.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/Error.java new file mode 100644 index 0000000000..72daaced63 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetimerfc1123.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/ErrorException.java new file mode 100644 index 0000000000..333a854f4a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydatetimerfc1123.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/package-info.java new file mode 100644 index 0000000000..a8b44bee85 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestRFC1123DateTimeTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydatetimerfc1123.models; diff --git a/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/package-info.java b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/package-info.java new file mode 100644 index 0000000000..50f6f7ab47 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydatetimerfc1123/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestRFC1123DateTimeTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodydatetimerfc1123; diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/AutoRestSwaggerBATdictionaryService.java b/test/vanilla/src/main/java/fixtures/bodydictionary/AutoRestSwaggerBATdictionaryService.java new file mode 100644 index 0000000000..bc5b33fd74 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/AutoRestSwaggerBATdictionaryService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydictionary; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestSwaggerBATdictionaryService class. + */ +public interface AutoRestSwaggerBATdictionaryService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Dictionarys object to access its operations. + * @return the Dictionarys object. + */ + Dictionarys dictionarys(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/Dictionarys.java b/test/vanilla/src/main/java/fixtures/bodydictionary/Dictionarys.java new file mode 100644 index 0000000000..3ab3851e2d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/Dictionarys.java @@ -0,0 +1,2351 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydictionary; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodydictionary.models.ErrorException; +import fixtures.bodydictionary.models.Widget; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Dictionarys. + */ +public interface Dictionarys { + /** + * Get null dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + Map getNull(); + + /** + * Get null dictionary value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get null dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable> getNullAsync(); + + /** + * Get null dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable>> getNullWithServiceResponseAsync(); + + /** + * Get empty dictionary value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + Map getEmpty(); + + /** + * Get empty dictionary value {}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getEmptyAsync(final ServiceCallback> serviceCallback); + + /** + * Get empty dictionary value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable> getEmptyAsync(); + + /** + * Get empty dictionary value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable>> getEmptyWithServiceResponseAsync(); + + /** + * Set dictionary value empty {}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putEmpty(Map arrayBody); + + /** + * Set dictionary value empty {}. + * + * @param arrayBody the Map<String, String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putEmptyAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value empty {}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putEmptyAsync(Map arrayBody); + + /** + * Set dictionary value empty {}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putEmptyWithServiceResponseAsync(Map arrayBody); + + /** + * Get Dictionary with null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + Map getNullValue(); + + /** + * Get Dictionary with null value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getNullValueAsync(final ServiceCallback> serviceCallback); + + /** + * Get Dictionary with null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable> getNullValueAsync(); + + /** + * Get Dictionary with null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable>> getNullValueWithServiceResponseAsync(); + + /** + * Get Dictionary with null key. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + Map getNullKey(); + + /** + * Get Dictionary with null key. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getNullKeyAsync(final ServiceCallback> serviceCallback); + + /** + * Get Dictionary with null key. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable> getNullKeyAsync(); + + /** + * Get Dictionary with null key. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable>> getNullKeyWithServiceResponseAsync(); + + /** + * Get Dictionary with key as empty string. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + Map getEmptyStringKey(); + + /** + * Get Dictionary with key as empty string. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getEmptyStringKeyAsync(final ServiceCallback> serviceCallback); + + /** + * Get Dictionary with key as empty string. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable> getEmptyStringKeyAsync(); + + /** + * Get Dictionary with key as empty string. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable>> getEmptyStringKeyWithServiceResponseAsync(); + + /** + * Get invalid Dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + Map getInvalid(); + + /** + * Get invalid Dictionary value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getInvalidAsync(final ServiceCallback> serviceCallback); + + /** + * Get invalid Dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable> getInvalidAsync(); + + /** + * Get invalid Dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable>> getInvalidWithServiceResponseAsync(); + + /** + * Get boolean dictionary value {"0": true, "1": false, "2": false, "3": true }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Boolean> object if successful. + */ + Map getBooleanTfft(); + + /** + * Get boolean dictionary value {"0": true, "1": false, "2": false, "3": true }. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getBooleanTfftAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean dictionary value {"0": true, "1": false, "2": false, "3": true }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + Observable> getBooleanTfftAsync(); + + /** + * Get boolean dictionary value {"0": true, "1": false, "2": false, "3": true }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + Observable>> getBooleanTfftWithServiceResponseAsync(); + + /** + * Set dictionary value empty {"0": true, "1": false, "2": false, "3": true }. + * + * @param arrayBody the Map<String, Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBooleanTfft(Map arrayBody); + + /** + * Set dictionary value empty {"0": true, "1": false, "2": false, "3": true }. + * + * @param arrayBody the Map<String, Boolean> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBooleanTfftAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value empty {"0": true, "1": false, "2": false, "3": true }. + * + * @param arrayBody the Map<String, Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBooleanTfftAsync(Map arrayBody); + + /** + * Set dictionary value empty {"0": true, "1": false, "2": false, "3": true }. + * + * @param arrayBody the Map<String, Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBooleanTfftWithServiceResponseAsync(Map arrayBody); + + /** + * Get boolean dictionary value {"0": true, "1": null, "2": false }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Boolean> object if successful. + */ + Map getBooleanInvalidNull(); + + /** + * Get boolean dictionary value {"0": true, "1": null, "2": false }. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getBooleanInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean dictionary value {"0": true, "1": null, "2": false }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + Observable> getBooleanInvalidNullAsync(); + + /** + * Get boolean dictionary value {"0": true, "1": null, "2": false }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + Observable>> getBooleanInvalidNullWithServiceResponseAsync(); + + /** + * Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Boolean> object if successful. + */ + Map getBooleanInvalidString(); + + /** + * Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getBooleanInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + Observable> getBooleanInvalidStringAsync(); + + /** + * Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + Observable>> getBooleanInvalidStringWithServiceResponseAsync(); + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + Map getIntegerValid(); + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getIntegerValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable> getIntegerValidAsync(); + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable>> getIntegerValidWithServiceResponseAsync(); + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putIntegerValid(Map arrayBody); + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Integer> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putIntegerValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putIntegerValidAsync(Map arrayBody); + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putIntegerValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get integer dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + Map getIntInvalidNull(); + + /** + * Get integer dictionary value {"0": 1, "1": null, "2": 0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getIntInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable> getIntInvalidNullAsync(); + + /** + * Get integer dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable>> getIntInvalidNullWithServiceResponseAsync(); + + /** + * Get integer dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + Map getIntInvalidString(); + + /** + * Get integer dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getIntInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable> getIntInvalidStringAsync(); + + /** + * Get integer dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable>> getIntInvalidStringWithServiceResponseAsync(); + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Long> object if successful. + */ + Map getLongValid(); + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getLongValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + Observable> getLongValidAsync(); + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + Observable>> getLongValidWithServiceResponseAsync(); + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putLongValid(Map arrayBody); + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Long> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putLongValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putLongValidAsync(Map arrayBody); + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putLongValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get long dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Long> object if successful. + */ + Map getLongInvalidNull(); + + /** + * Get long dictionary value {"0": 1, "1": null, "2": 0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getLongInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get long dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + Observable> getLongInvalidNullAsync(); + + /** + * Get long dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + Observable>> getLongInvalidNullWithServiceResponseAsync(); + + /** + * Get long dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Long> object if successful. + */ + Map getLongInvalidString(); + + /** + * Get long dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getLongInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get long dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + Observable> getLongInvalidStringAsync(); + + /** + * Get long dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + Observable>> getLongInvalidStringWithServiceResponseAsync(); + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + Map getFloatValid(); + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getFloatValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable> getFloatValidAsync(); + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable>> getFloatValidWithServiceResponseAsync(); + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putFloatValid(Map arrayBody); + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putFloatValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putFloatValidAsync(Map arrayBody); + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putFloatValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + Map getFloatInvalidNull(); + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getFloatInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable> getFloatInvalidNullAsync(); + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable>> getFloatInvalidNullWithServiceResponseAsync(); + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + Map getFloatInvalidString(); + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getFloatInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable> getFloatInvalidStringAsync(); + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable>> getFloatInvalidStringWithServiceResponseAsync(); + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + Map getDoubleValid(); + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDoubleValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable> getDoubleValidAsync(); + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable>> getDoubleValidWithServiceResponseAsync(); + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDoubleValid(Map arrayBody); + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDoubleValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDoubleValidAsync(Map arrayBody); + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDoubleValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + Map getDoubleInvalidNull(); + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDoubleInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable> getDoubleInvalidNullAsync(); + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable>> getDoubleInvalidNullWithServiceResponseAsync(); + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + Map getDoubleInvalidString(); + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDoubleInvalidStringAsync(final ServiceCallback> serviceCallback); + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable> getDoubleInvalidStringAsync(); + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + Observable>> getDoubleInvalidStringWithServiceResponseAsync(); + + /** + * Get string dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + Map getStringValid(); + + /** + * Get string dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStringValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get string dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable> getStringValidAsync(); + + /** + * Get string dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable>> getStringValidWithServiceResponseAsync(); + + /** + * Set dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putStringValid(Map arrayBody); + + /** + * Set dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param arrayBody the Map<String, String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putStringValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putStringValidAsync(Map arrayBody); + + /** + * Set dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putStringValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get string dictionary value {"0": "foo", "1": null, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + Map getStringWithNull(); + + /** + * Get string dictionary value {"0": "foo", "1": null, "2": "foo2"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStringWithNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get string dictionary value {"0": "foo", "1": null, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable> getStringWithNullAsync(); + + /** + * Get string dictionary value {"0": "foo", "1": null, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable>> getStringWithNullWithServiceResponseAsync(); + + /** + * Get string dictionary value {"0": "foo", "1": 123, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + Map getStringWithInvalid(); + + /** + * Get string dictionary value {"0": "foo", "1": 123, "2": "foo2"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getStringWithInvalidAsync(final ServiceCallback> serviceCallback); + + /** + * Get string dictionary value {"0": "foo", "1": 123, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable> getStringWithInvalidAsync(); + + /** + * Get string dictionary value {"0": "foo", "1": 123, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + Observable>> getStringWithInvalidWithServiceResponseAsync(); + + /** + * Get integer dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, LocalDate> object if successful. + */ + Map getDateValid(); + + /** + * Get integer dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get integer dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + Observable> getDateValidAsync(); + + /** + * Get integer dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + Observable>> getDateValidWithServiceResponseAsync(); + + /** + * Set dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param arrayBody the Map<String, LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDateValid(Map arrayBody); + + /** + * Set dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param arrayBody the Map<String, LocalDate> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param arrayBody the Map<String, LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateValidAsync(Map arrayBody); + + /** + * Set dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param arrayBody the Map<String, LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get date dictionary value {"0": "2012-01-01", "1": null, "2": "1776-07-04"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, LocalDate> object if successful. + */ + Map getDateInvalidNull(); + + /** + * Get date dictionary value {"0": "2012-01-01", "1": null, "2": "1776-07-04"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get date dictionary value {"0": "2012-01-01", "1": null, "2": "1776-07-04"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + Observable> getDateInvalidNullAsync(); + + /** + * Get date dictionary value {"0": "2012-01-01", "1": null, "2": "1776-07-04"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + Observable>> getDateInvalidNullWithServiceResponseAsync(); + + /** + * Get date dictionary value {"0": "2011-03-22", "1": "date"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, LocalDate> object if successful. + */ + Map getDateInvalidChars(); + + /** + * Get date dictionary value {"0": "2011-03-22", "1": "date"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateInvalidCharsAsync(final ServiceCallback> serviceCallback); + + /** + * Get date dictionary value {"0": "2011-03-22", "1": "date"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + Observable> getDateInvalidCharsAsync(); + + /** + * Get date dictionary value {"0": "2011-03-22", "1": "date"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + Observable>> getDateInvalidCharsWithServiceResponseAsync(); + + /** + * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, DateTime> object if successful. + */ + Map getDateTimeValid(); + + /** + * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateTimeValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + Observable> getDateTimeValidAsync(); + + /** + * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + Observable>> getDateTimeValidWithServiceResponseAsync(); + + /** + * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param arrayBody the Map<String, DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDateTimeValid(Map arrayBody); + + /** + * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param arrayBody the Map<String, DateTime> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateTimeValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param arrayBody the Map<String, DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateTimeValidAsync(Map arrayBody); + + /** + * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param arrayBody the Map<String, DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateTimeValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, DateTime> object if successful. + */ + Map getDateTimeInvalidNull(); + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateTimeInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + Observable> getDateTimeInvalidNullAsync(); + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + Observable>> getDateTimeInvalidNullWithServiceResponseAsync(); + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, DateTime> object if successful. + */ + Map getDateTimeInvalidChars(); + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateTimeInvalidCharsAsync(final ServiceCallback> serviceCallback); + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + Observable> getDateTimeInvalidCharsAsync(); + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + Observable>> getDateTimeInvalidCharsWithServiceResponseAsync(); + + /** + * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, DateTime> object if successful. + */ + Map getDateTimeRfc1123Valid(); + + /** + * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDateTimeRfc1123ValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + Observable> getDateTimeRfc1123ValidAsync(); + + /** + * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + Observable>> getDateTimeRfc1123ValidWithServiceResponseAsync(); + + /** + * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param arrayBody the Map<String, DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDateTimeRfc1123Valid(Map arrayBody); + + /** + * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param arrayBody the Map<String, DateTimeRfc1123> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDateTimeRfc1123ValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param arrayBody the Map<String, DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDateTimeRfc1123ValidAsync(Map arrayBody); + + /** + * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param arrayBody the Map<String, DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDateTimeRfc1123ValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Period> object if successful. + */ + Map getDurationValid(); + + /** + * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDurationValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Period> object + */ + Observable> getDurationValidAsync(); + + /** + * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Period> object + */ + Observable>> getDurationValidWithServiceResponseAsync(); + + /** + * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param arrayBody the Map<String, Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDurationValid(Map arrayBody); + + /** + * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param arrayBody the Map<String, Period> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDurationValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param arrayBody the Map<String, Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDurationValidAsync(Map arrayBody); + + /** + * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param arrayBody the Map<String, Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDurationValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, byte[]> object if successful. + */ + Map getByteValid(); + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getByteValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + Observable> getByteValidAsync(); + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + Observable>> getByteValidWithServiceResponseAsync(); + + /** + * Put the dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each elementencoded in base 64. + * + * @param arrayBody the Map<String, byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putByteValid(Map arrayBody); + + /** + * Put the dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each elementencoded in base 64. + * + * @param arrayBody the Map<String, byte[]> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putByteValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Put the dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each elementencoded in base 64. + * + * @param arrayBody the Map<String, byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putByteValidAsync(Map arrayBody); + + /** + * Put the dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each elementencoded in base 64. + * + * @param arrayBody the Map<String, byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putByteValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": null} with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, byte[]> object if successful. + */ + Map getByteInvalidNull(); + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": null} with the first item base64 encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getByteInvalidNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": null} with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + Observable> getByteInvalidNullAsync(); + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": null} with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + Observable>> getByteInvalidNullWithServiceResponseAsync(); + + /** + * Get base64url dictionary value {"0": "a string that gets encoded with base64url", "1": "test string", "2": "Lorem ipsum"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, byte[]> object if successful. + */ + Map getBase64Url(); + + /** + * Get base64url dictionary value {"0": "a string that gets encoded with base64url", "1": "test string", "2": "Lorem ipsum"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getBase64UrlAsync(final ServiceCallback> serviceCallback); + + /** + * Get base64url dictionary value {"0": "a string that gets encoded with base64url", "1": "test string", "2": "Lorem ipsum"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + Observable> getBase64UrlAsync(); + + /** + * Get base64url dictionary value {"0": "a string that gets encoded with base64url", "1": "test string", "2": "Lorem ipsum"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + Observable>> getBase64UrlWithServiceResponseAsync(); + + /** + * Get dictionary of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + Map getComplexNull(); + + /** + * Get dictionary of complex type null value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get dictionary of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable> getComplexNullAsync(); + + /** + * Get dictionary of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable>> getComplexNullWithServiceResponseAsync(); + + /** + * Get empty dictionary of complex type {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + Map getComplexEmpty(); + + /** + * Get empty dictionary of complex type {}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexEmptyAsync(final ServiceCallback> serviceCallback); + + /** + * Get empty dictionary of complex type {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable> getComplexEmptyAsync(); + + /** + * Get empty dictionary of complex type {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable>> getComplexEmptyWithServiceResponseAsync(); + + /** + * Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + Map getComplexItemNull(); + + /** + * Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexItemNullAsync(final ServiceCallback> serviceCallback); + + /** + * Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable> getComplexItemNullAsync(); + + /** + * Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable>> getComplexItemNullWithServiceResponseAsync(); + + /** + * Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + Map getComplexItemEmpty(); + + /** + * Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexItemEmptyAsync(final ServiceCallback> serviceCallback); + + /** + * Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable> getComplexItemEmptyAsync(); + + /** + * Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable>> getComplexItemEmptyWithServiceResponseAsync(); + + /** + * Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + Map getComplexValid(); + + /** + * Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getComplexValidAsync(final ServiceCallback> serviceCallback); + + /** + * Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable> getComplexValidAsync(); + + /** + * Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + Observable>> getComplexValidWithServiceResponseAsync(); + + /** + * Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param arrayBody the Map<String, Widget> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putComplexValid(Map arrayBody); + + /** + * Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param arrayBody the Map<String, Widget> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putComplexValidAsync(Map arrayBody, final ServiceCallback serviceCallback); + + /** + * Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param arrayBody the Map<String, Widget> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putComplexValidAsync(Map arrayBody); + + /** + * Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param arrayBody the Map<String, Widget> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putComplexValidWithServiceResponseAsync(Map arrayBody); + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + Map> getArrayNull(); + + /** + * Get a null array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayNullAsync(final ServiceCallback>> serviceCallback); + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>> getArrayNullAsync(); + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>>> getArrayNullWithServiceResponseAsync(); + + /** + * Get an empty dictionary {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + Map> getArrayEmpty(); + + /** + * Get an empty dictionary {}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayEmptyAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an empty dictionary {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>> getArrayEmptyAsync(); + + /** + * Get an empty dictionary {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>>> getArrayEmptyWithServiceResponseAsync(); + + /** + * Get an dictionary of array of strings {"0": ["1", "2", "3"], "1": null, "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + Map> getArrayItemNull(); + + /** + * Get an dictionary of array of strings {"0": ["1", "2", "3"], "1": null, "2": ["7", "8", "9"]}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayItemNullAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an dictionary of array of strings {"0": ["1", "2", "3"], "1": null, "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>> getArrayItemNullAsync(); + + /** + * Get an dictionary of array of strings {"0": ["1", "2", "3"], "1": null, "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>>> getArrayItemNullWithServiceResponseAsync(); + + /** + * Get an array of array of strings [{"0": ["1", "2", "3"], "1": [], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + Map> getArrayItemEmpty(); + + /** + * Get an array of array of strings [{"0": ["1", "2", "3"], "1": [], "2": ["7", "8", "9"]}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayItemEmptyAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of array of strings [{"0": ["1", "2", "3"], "1": [], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>> getArrayItemEmptyAsync(); + + /** + * Get an array of array of strings [{"0": ["1", "2", "3"], "1": [], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>>> getArrayItemEmptyWithServiceResponseAsync(); + + /** + * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + Map> getArrayValid(); + + /** + * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getArrayValidAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>> getArrayValidAsync(); + + /** + * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + Observable>>> getArrayValidWithServiceResponseAsync(); + + /** + * Put An array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param arrayBody the Map<String, List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putArrayValid(Map> arrayBody); + + /** + * Put An array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param arrayBody the Map<String, List<String>> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putArrayValidAsync(Map> arrayBody, final ServiceCallback serviceCallback); + + /** + * Put An array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param arrayBody the Map<String, List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putArrayValidAsync(Map> arrayBody); + + /** + * Put An array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param arrayBody the Map<String, List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putArrayValidWithServiceResponseAsync(Map> arrayBody); + + /** + * Get an dictionaries of dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + Map> getDictionaryNull(); + + /** + * Get an dictionaries of dictionaries with value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryNullAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an dictionaries of dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>> getDictionaryNullAsync(); + + /** + * Get an dictionaries of dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>>> getDictionaryNullWithServiceResponseAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + Map> getDictionaryEmpty(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryEmptyAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>> getDictionaryEmptyAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>>> getDictionaryEmptyWithServiceResponseAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": null, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + Map> getDictionaryItemNull(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": null, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryItemNullAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": null, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>> getDictionaryItemNullAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": null, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>>> getDictionaryItemNullWithServiceResponseAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + Map> getDictionaryItemEmpty(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryItemEmptyAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>> getDictionaryItemEmptyAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>>> getDictionaryItemEmptyWithServiceResponseAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + Map> getDictionaryValid(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture>> getDictionaryValidAsync(final ServiceCallback>> serviceCallback); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>> getDictionaryValidAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + Observable>>> getDictionaryValidWithServiceResponseAsync(); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param arrayBody the Map<String, Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDictionaryValid(Map> arrayBody); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param arrayBody the Map<String, Map<String, String>> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDictionaryValidAsync(Map> arrayBody, final ServiceCallback serviceCallback); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param arrayBody the Map<String, Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDictionaryValidAsync(Map> arrayBody); + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param arrayBody the Map<String, Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDictionaryValidWithServiceResponseAsync(Map> arrayBody); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/AutoRestSwaggerBATdictionaryServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/AutoRestSwaggerBATdictionaryServiceImpl.java new file mode 100644 index 0000000000..9dfecd0845 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/AutoRestSwaggerBATdictionaryServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydictionary.implementation; + +import fixtures.bodydictionary.AutoRestSwaggerBATdictionaryService; +import fixtures.bodydictionary.Dictionarys; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestSwaggerBATdictionaryService class. + */ +public class AutoRestSwaggerBATdictionaryServiceImpl extends ServiceClient implements AutoRestSwaggerBATdictionaryService { + + /** + * The Dictionarys object to access its operations. + */ + private Dictionarys dictionarys; + + /** + * Gets the Dictionarys object to access its operations. + * @return the Dictionarys object. + */ + public Dictionarys dictionarys() { + return this.dictionarys; + } + + /** + * Initializes an instance of AutoRestSwaggerBATdictionaryService client. + */ + public AutoRestSwaggerBATdictionaryServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestSwaggerBATdictionaryService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestSwaggerBATdictionaryServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATdictionaryService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATdictionaryServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATdictionaryService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATdictionaryServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATdictionaryService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestSwaggerBATdictionaryServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.dictionarys = new DictionarysImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/DictionarysImpl.java b/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/DictionarysImpl.java new file mode 100644 index 0000000000..6524b4258d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/DictionarysImpl.java @@ -0,0 +1,4748 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydictionary.implementation; + +import retrofit2.Retrofit; +import fixtures.bodydictionary.Dictionarys; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.Base64Url; +import com.microsoft.rest.DateTimeRfc1123; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodydictionary.models.ErrorException; +import fixtures.bodydictionary.models.Widget; +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Dictionarys. + */ +public class DictionarysImpl implements Dictionarys { + /** The Retrofit service to perform REST calls. */ + private DictionarysService service; + /** The service client containing this operation class. */ + private AutoRestSwaggerBATdictionaryServiceImpl client; + + /** + * Initializes an instance of Dictionarys. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DictionarysImpl(Retrofit retrofit, AutoRestSwaggerBATdictionaryServiceImpl client) { + this.service = retrofit.create(DictionarysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Dictionarys to be + * used by Retrofit to perform actually REST calls. + */ + interface DictionarysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getNull" }) + @GET("dictionary/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getEmpty" }) + @GET("dictionary/empty") + Observable> getEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putEmpty" }) + @PUT("dictionary/empty") + Observable> putEmpty(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getNullValue" }) + @GET("dictionary/nullvalue") + Observable> getNullValue(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getNullKey" }) + @GET("dictionary/nullkey") + Observable> getNullKey(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getEmptyStringKey" }) + @GET("dictionary/keyemptystring") + Observable> getEmptyStringKey(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getInvalid" }) + @GET("dictionary/invalid") + Observable> getInvalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getBooleanTfft" }) + @GET("dictionary/prim/boolean/tfft") + Observable> getBooleanTfft(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putBooleanTfft" }) + @PUT("dictionary/prim/boolean/tfft") + Observable> putBooleanTfft(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getBooleanInvalidNull" }) + @GET("dictionary/prim/boolean/true.null.false") + Observable> getBooleanInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getBooleanInvalidString" }) + @GET("dictionary/prim/boolean/true.boolean.false") + Observable> getBooleanInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getIntegerValid" }) + @GET("dictionary/prim/integer/1.-1.3.300") + Observable> getIntegerValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putIntegerValid" }) + @PUT("dictionary/prim/integer/1.-1.3.300") + Observable> putIntegerValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getIntInvalidNull" }) + @GET("dictionary/prim/integer/1.null.zero") + Observable> getIntInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getIntInvalidString" }) + @GET("dictionary/prim/integer/1.integer.0") + Observable> getIntInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getLongValid" }) + @GET("dictionary/prim/long/1.-1.3.300") + Observable> getLongValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putLongValid" }) + @PUT("dictionary/prim/long/1.-1.3.300") + Observable> putLongValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getLongInvalidNull" }) + @GET("dictionary/prim/long/1.null.zero") + Observable> getLongInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getLongInvalidString" }) + @GET("dictionary/prim/long/1.integer.0") + Observable> getLongInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getFloatValid" }) + @GET("dictionary/prim/float/0--0.01-1.2e20") + Observable> getFloatValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putFloatValid" }) + @PUT("dictionary/prim/float/0--0.01-1.2e20") + Observable> putFloatValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getFloatInvalidNull" }) + @GET("dictionary/prim/float/0.0-null-1.2e20") + Observable> getFloatInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getFloatInvalidString" }) + @GET("dictionary/prim/float/1.number.0") + Observable> getFloatInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDoubleValid" }) + @GET("dictionary/prim/double/0--0.01-1.2e20") + Observable> getDoubleValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putDoubleValid" }) + @PUT("dictionary/prim/double/0--0.01-1.2e20") + Observable> putDoubleValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDoubleInvalidNull" }) + @GET("dictionary/prim/double/0.0-null-1.2e20") + Observable> getDoubleInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDoubleInvalidString" }) + @GET("dictionary/prim/double/1.number.0") + Observable> getDoubleInvalidString(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getStringValid" }) + @GET("dictionary/prim/string/foo1.foo2.foo3") + Observable> getStringValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putStringValid" }) + @PUT("dictionary/prim/string/foo1.foo2.foo3") + Observable> putStringValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getStringWithNull" }) + @GET("dictionary/prim/string/foo.null.foo2") + Observable> getStringWithNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getStringWithInvalid" }) + @GET("dictionary/prim/string/foo.123.foo2") + Observable> getStringWithInvalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDateValid" }) + @GET("dictionary/prim/date/valid") + Observable> getDateValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putDateValid" }) + @PUT("dictionary/prim/date/valid") + Observable> putDateValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDateInvalidNull" }) + @GET("dictionary/prim/date/invalidnull") + Observable> getDateInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDateInvalidChars" }) + @GET("dictionary/prim/date/invalidchars") + Observable> getDateInvalidChars(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDateTimeValid" }) + @GET("dictionary/prim/date-time/valid") + Observable> getDateTimeValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putDateTimeValid" }) + @PUT("dictionary/prim/date-time/valid") + Observable> putDateTimeValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDateTimeInvalidNull" }) + @GET("dictionary/prim/date-time/invalidnull") + Observable> getDateTimeInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDateTimeInvalidChars" }) + @GET("dictionary/prim/date-time/invalidchars") + Observable> getDateTimeInvalidChars(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDateTimeRfc1123Valid" }) + @GET("dictionary/prim/date-time-rfc1123/valid") + Observable> getDateTimeRfc1123Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putDateTimeRfc1123Valid" }) + @PUT("dictionary/prim/date-time-rfc1123/valid") + Observable> putDateTimeRfc1123Valid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDurationValid" }) + @GET("dictionary/prim/duration/valid") + Observable> getDurationValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putDurationValid" }) + @PUT("dictionary/prim/duration/valid") + Observable> putDurationValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getByteValid" }) + @GET("dictionary/prim/byte/valid") + Observable> getByteValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putByteValid" }) + @PUT("dictionary/prim/byte/valid") + Observable> putByteValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getByteInvalidNull" }) + @GET("dictionary/prim/byte/invalidnull") + Observable> getByteInvalidNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getBase64Url" }) + @GET("dictionary/prim/base64url/valid") + Observable> getBase64Url(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getComplexNull" }) + @GET("dictionary/complex/null") + Observable> getComplexNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getComplexEmpty" }) + @GET("dictionary/complex/empty") + Observable> getComplexEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getComplexItemNull" }) + @GET("dictionary/complex/itemnull") + Observable> getComplexItemNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getComplexItemEmpty" }) + @GET("dictionary/complex/itemempty") + Observable> getComplexItemEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getComplexValid" }) + @GET("dictionary/complex/valid") + Observable> getComplexValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putComplexValid" }) + @PUT("dictionary/complex/valid") + Observable> putComplexValid(@Body Map arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getArrayNull" }) + @GET("dictionary/array/null") + Observable> getArrayNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getArrayEmpty" }) + @GET("dictionary/array/empty") + Observable> getArrayEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getArrayItemNull" }) + @GET("dictionary/array/itemnull") + Observable> getArrayItemNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getArrayItemEmpty" }) + @GET("dictionary/array/itemempty") + Observable> getArrayItemEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getArrayValid" }) + @GET("dictionary/array/valid") + Observable> getArrayValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putArrayValid" }) + @PUT("dictionary/array/valid") + Observable> putArrayValid(@Body Map> arrayBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDictionaryNull" }) + @GET("dictionary/dictionary/null") + Observable> getDictionaryNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDictionaryEmpty" }) + @GET("dictionary/dictionary/empty") + Observable> getDictionaryEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDictionaryItemNull" }) + @GET("dictionary/dictionary/itemnull") + Observable> getDictionaryItemNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDictionaryItemEmpty" }) + @GET("dictionary/dictionary/itemempty") + Observable> getDictionaryItemEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys getDictionaryValid" }) + @GET("dictionary/dictionary/valid") + Observable> getDictionaryValid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodydictionary.Dictionarys putDictionaryValid" }) + @PUT("dictionary/dictionary/valid") + Observable> putDictionaryValid(@Body Map> arrayBody); + + } + + /** + * Get null dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + public Map getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null dictionary value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable> getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get null dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable>> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get empty dictionary value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + public Map getEmpty() { + return getEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty dictionary value {}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getEmptyAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty dictionary value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable> getEmptyAsync() { + return getEmptyWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get empty dictionary value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable>> getEmptyWithServiceResponseAsync() { + return service.getEmpty() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value empty {}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putEmpty(Map arrayBody) { + putEmptyWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value empty {}. + * + * @param arrayBody the Map<String, String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putEmptyAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putEmptyWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value empty {}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putEmptyAsync(Map arrayBody) { + return putEmptyWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value empty {}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putEmptyWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putEmpty(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get Dictionary with null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map getNullValue() { + return getNullValueWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get Dictionary with null value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getNullValueAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getNullValueWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get Dictionary with null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getNullValueAsync() { + return getNullValueWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get Dictionary with null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getNullValueWithServiceResponseAsync() { + return service.getNullValue() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getNullValueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getNullValueDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get Dictionary with null key. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map getNullKey() { + return getNullKeyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get Dictionary with null key. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getNullKeyAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getNullKeyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get Dictionary with null key. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getNullKeyAsync() { + return getNullKeyWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get Dictionary with null key. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getNullKeyWithServiceResponseAsync() { + return service.getNullKey() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getNullKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getNullKeyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get Dictionary with key as empty string. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map getEmptyStringKey() { + return getEmptyStringKeyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get Dictionary with key as empty string. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getEmptyStringKeyAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getEmptyStringKeyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get Dictionary with key as empty string. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getEmptyStringKeyAsync() { + return getEmptyStringKeyWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get Dictionary with key as empty string. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getEmptyStringKeyWithServiceResponseAsync() { + return service.getEmptyStringKey() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getEmptyStringKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getEmptyStringKeyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid Dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid Dictionary value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getInvalidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid Dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get invalid Dictionary value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean dictionary value {"0": true, "1": false, "2": false, "3": true }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Boolean> object if successful. + */ + public Map getBooleanTfft() { + return getBooleanTfftWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean dictionary value {"0": true, "1": false, "2": false, "3": true }. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getBooleanTfftAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getBooleanTfftWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean dictionary value {"0": true, "1": false, "2": false, "3": true }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + public Observable> getBooleanTfftAsync() { + return getBooleanTfftWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean dictionary value {"0": true, "1": false, "2": false, "3": true }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + public Observable>> getBooleanTfftWithServiceResponseAsync() { + return service.getBooleanTfft() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getBooleanTfftDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getBooleanTfftDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value empty {"0": true, "1": false, "2": false, "3": true }. + * + * @param arrayBody the Map<String, Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBooleanTfft(Map arrayBody) { + putBooleanTfftWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value empty {"0": true, "1": false, "2": false, "3": true }. + * + * @param arrayBody the Map<String, Boolean> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBooleanTfftAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBooleanTfftWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value empty {"0": true, "1": false, "2": false, "3": true }. + * + * @param arrayBody the Map<String, Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBooleanTfftAsync(Map arrayBody) { + return putBooleanTfftWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value empty {"0": true, "1": false, "2": false, "3": true }. + * + * @param arrayBody the Map<String, Boolean> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBooleanTfftWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putBooleanTfft(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBooleanTfftDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBooleanTfftDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean dictionary value {"0": true, "1": null, "2": false }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Boolean> object if successful. + */ + public Map getBooleanInvalidNull() { + return getBooleanInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean dictionary value {"0": true, "1": null, "2": false }. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getBooleanInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getBooleanInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean dictionary value {"0": true, "1": null, "2": false }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + public Observable> getBooleanInvalidNullAsync() { + return getBooleanInvalidNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean dictionary value {"0": true, "1": null, "2": false }. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + public Observable>> getBooleanInvalidNullWithServiceResponseAsync() { + return service.getBooleanInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getBooleanInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getBooleanInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Boolean> object if successful. + */ + public Map getBooleanInvalidString() { + return getBooleanInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getBooleanInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getBooleanInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + public Observable> getBooleanInvalidStringAsync() { + return getBooleanInvalidStringWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean dictionary value '{"0": true, "1": "boolean", "2": false}'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Boolean> object + */ + public Observable>> getBooleanInvalidStringWithServiceResponseAsync() { + return service.getBooleanInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getBooleanInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getBooleanInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + public Map getIntegerValid() { + return getIntegerValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getIntegerValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getIntegerValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable> getIntegerValidAsync() { + return getIntegerValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable>> getIntegerValidWithServiceResponseAsync() { + return service.getIntegerValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getIntegerValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getIntegerValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putIntegerValid(Map arrayBody) { + putIntegerValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Integer> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putIntegerValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putIntegerValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putIntegerValidAsync(Map arrayBody) { + return putIntegerValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Integer> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putIntegerValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putIntegerValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putIntegerValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putIntegerValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + public Map getIntInvalidNull() { + return getIntInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer dictionary value {"0": 1, "1": null, "2": 0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getIntInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getIntInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable> getIntInvalidNullAsync() { + return getIntInvalidNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable>> getIntInvalidNullWithServiceResponseAsync() { + return service.getIntInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getIntInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getIntInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + public Map getIntInvalidString() { + return getIntInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getIntInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getIntInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable> getIntInvalidStringAsync() { + return getIntInvalidStringWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable>> getIntInvalidStringWithServiceResponseAsync() { + return service.getIntInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getIntInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getIntInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Long> object if successful. + */ + public Map getLongValid() { + return getLongValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getLongValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getLongValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + public Observable> getLongValidAsync() { + return getLongValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer dictionary value {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + public Observable>> getLongValidWithServiceResponseAsync() { + return service.getLongValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getLongValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getLongValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putLongValid(Map arrayBody) { + putLongValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Long> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putLongValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putLongValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putLongValidAsync(Map arrayBody) { + return putLongValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value empty {"0": 1, "1": -1, "2": 3, "3": 300}. + * + * @param arrayBody the Map<String, Long> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putLongValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putLongValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putLongValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putLongValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get long dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Long> object if successful. + */ + public Map getLongInvalidNull() { + return getLongInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get long dictionary value {"0": 1, "1": null, "2": 0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getLongInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getLongInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get long dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + public Observable> getLongInvalidNullAsync() { + return getLongInvalidNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get long dictionary value {"0": 1, "1": null, "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + public Observable>> getLongInvalidNullWithServiceResponseAsync() { + return service.getLongInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getLongInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getLongInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get long dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Long> object if successful. + */ + public Map getLongInvalidString() { + return getLongInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get long dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getLongInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getLongInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get long dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + public Observable> getLongInvalidStringAsync() { + return getLongInvalidStringWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get long dictionary value {"0": 1, "1": "integer", "2": 0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Long> object + */ + public Observable>> getLongInvalidStringWithServiceResponseAsync() { + return service.getLongInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getLongInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getLongInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + public Map getFloatValid() { + return getFloatValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getFloatValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getFloatValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable> getFloatValidAsync() { + return getFloatValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable>> getFloatValidWithServiceResponseAsync() { + return service.getFloatValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getFloatValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getFloatValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putFloatValid(Map arrayBody) { + putFloatValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putFloatValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putFloatValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putFloatValidAsync(Map arrayBody) { + return putFloatValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putFloatValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putFloatValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putFloatValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putFloatValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + public Map getFloatInvalidNull() { + return getFloatInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getFloatInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getFloatInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable> getFloatInvalidNullAsync() { + return getFloatInvalidNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable>> getFloatInvalidNullWithServiceResponseAsync() { + return service.getFloatInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getFloatInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getFloatInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + public Map getFloatInvalidString() { + return getFloatInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getFloatInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getFloatInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable> getFloatInvalidStringAsync() { + return getFloatInvalidStringWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable>> getFloatInvalidStringWithServiceResponseAsync() { + return service.getFloatInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getFloatInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getFloatInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + public Map getDoubleValid() { + return getDoubleValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDoubleValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDoubleValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable> getDoubleValidAsync() { + return getDoubleValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get float dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable>> getDoubleValidWithServiceResponseAsync() { + return service.getDoubleValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDoubleValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDoubleValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDoubleValid(Map arrayBody) { + putDoubleValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDoubleValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDoubleValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDoubleValidAsync(Map arrayBody) { + return putDoubleValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value {"0": 0, "1": -0.01, "2": 1.2e20}. + * + * @param arrayBody the Map<String, Double> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDoubleValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDoubleValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDoubleValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDoubleValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + public Map getDoubleInvalidNull() { + return getDoubleInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDoubleInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDoubleInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable> getDoubleInvalidNullAsync() { + return getDoubleInvalidNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get float dictionary value {"0": 0.0, "1": null, "2": 1.2e20}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable>> getDoubleInvalidNullWithServiceResponseAsync() { + return service.getDoubleInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDoubleInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDoubleInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Double> object if successful. + */ + public Map getDoubleInvalidString() { + return getDoubleInvalidStringWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDoubleInvalidStringAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDoubleInvalidStringWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable> getDoubleInvalidStringAsync() { + return getDoubleInvalidStringWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get boolean dictionary value {"0": 1.0, "1": "number", "2": 0.0}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Double> object + */ + public Observable>> getDoubleInvalidStringWithServiceResponseAsync() { + return service.getDoubleInvalidString() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDoubleInvalidStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDoubleInvalidStringDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get string dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map getStringValid() { + return getStringValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get string dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStringValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getStringValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get string dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getStringValidAsync() { + return getStringValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get string dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getStringValidWithServiceResponseAsync() { + return service.getStringValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getStringValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getStringValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putStringValid(Map arrayBody) { + putStringValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param arrayBody the Map<String, String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putStringValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putStringValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putStringValidAsync(Map arrayBody) { + return putStringValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value {"0": "foo1", "1": "foo2", "2": "foo3"}. + * + * @param arrayBody the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putStringValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putStringValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putStringValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putStringValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get string dictionary value {"0": "foo", "1": null, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map getStringWithNull() { + return getStringWithNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get string dictionary value {"0": "foo", "1": null, "2": "foo2"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStringWithNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getStringWithNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get string dictionary value {"0": "foo", "1": null, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getStringWithNullAsync() { + return getStringWithNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get string dictionary value {"0": "foo", "1": null, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getStringWithNullWithServiceResponseAsync() { + return service.getStringWithNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getStringWithNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getStringWithNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get string dictionary value {"0": "foo", "1": 123, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, String> object if successful. + */ + public Map getStringWithInvalid() { + return getStringWithInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get string dictionary value {"0": "foo", "1": 123, "2": "foo2"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getStringWithInvalidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getStringWithInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get string dictionary value {"0": "foo", "1": 123, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable> getStringWithInvalidAsync() { + return getStringWithInvalidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get string dictionary value {"0": "foo", "1": 123, "2": "foo2"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, String> object + */ + public Observable>> getStringWithInvalidWithServiceResponseAsync() { + return service.getStringWithInvalid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getStringWithInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getStringWithInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get integer dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, LocalDate> object if successful. + */ + public Map getDateValid() { + return getDateValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get integer dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get integer dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + public Observable> getDateValidAsync() { + return getDateValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get integer dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + public Observable>> getDateValidWithServiceResponseAsync() { + return service.getDateValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param arrayBody the Map<String, LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDateValid(Map arrayBody) { + putDateValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param arrayBody the Map<String, LocalDate> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param arrayBody the Map<String, LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateValidAsync(Map arrayBody) { + return putDateValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value {"0": "2000-12-01", "1": "1980-01-02", "2": "1492-10-12"}. + * + * @param arrayBody the Map<String, LocalDate> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDateValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date dictionary value {"0": "2012-01-01", "1": null, "2": "1776-07-04"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, LocalDate> object if successful. + */ + public Map getDateInvalidNull() { + return getDateInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date dictionary value {"0": "2012-01-01", "1": null, "2": "1776-07-04"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date dictionary value {"0": "2012-01-01", "1": null, "2": "1776-07-04"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + public Observable> getDateInvalidNullAsync() { + return getDateInvalidNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date dictionary value {"0": "2012-01-01", "1": null, "2": "1776-07-04"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + public Observable>> getDateInvalidNullWithServiceResponseAsync() { + return service.getDateInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date dictionary value {"0": "2011-03-22", "1": "date"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, LocalDate> object if successful. + */ + public Map getDateInvalidChars() { + return getDateInvalidCharsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date dictionary value {"0": "2011-03-22", "1": "date"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateInvalidCharsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateInvalidCharsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date dictionary value {"0": "2011-03-22", "1": "date"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + public Observable> getDateInvalidCharsAsync() { + return getDateInvalidCharsWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date dictionary value {"0": "2011-03-22", "1": "date"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, LocalDate> object + */ + public Observable>> getDateInvalidCharsWithServiceResponseAsync() { + return service.getDateInvalidChars() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateInvalidCharsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateInvalidCharsDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, DateTime> object if successful. + */ + public Map getDateTimeValid() { + return getDateTimeValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateTimeValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + public Observable> getDateTimeValidAsync() { + return getDateTimeValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date-time dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + public Observable>> getDateTimeValidWithServiceResponseAsync() { + return service.getDateTimeValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateTimeValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateTimeValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param arrayBody the Map<String, DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDateTimeValid(Map arrayBody) { + putDateTimeValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param arrayBody the Map<String, DateTime> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateTimeValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateTimeValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param arrayBody the Map<String, DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateTimeValidAsync(Map arrayBody) { + return putDateTimeValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value {"0": "2000-12-01t00:00:01z", "1": "1980-01-02T00:11:35+01:00", "2": "1492-10-12T10:15:01-08:00"}. + * + * @param arrayBody the Map<String, DateTime> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateTimeValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDateTimeValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateTimeValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateTimeValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, DateTime> object if successful. + */ + public Map getDateTimeInvalidNull() { + return getDateTimeInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateTimeInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + public Observable> getDateTimeInvalidNullAsync() { + return getDateTimeInvalidNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": null}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + public Observable>> getDateTimeInvalidNullWithServiceResponseAsync() { + return service.getDateTimeInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateTimeInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateTimeInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, DateTime> object if successful. + */ + public Map getDateTimeInvalidChars() { + return getDateTimeInvalidCharsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateTimeInvalidCharsAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeInvalidCharsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + public Observable> getDateTimeInvalidCharsAsync() { + return getDateTimeInvalidCharsWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date dictionary value {"0": "2000-12-01t00:00:01z", "1": "date-time"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + public Observable>> getDateTimeInvalidCharsWithServiceResponseAsync() { + return service.getDateTimeInvalidChars() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDateTimeInvalidCharsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateTimeInvalidCharsDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, DateTime> object if successful. + */ + public Map getDateTimeRfc1123Valid() { + return getDateTimeRfc1123ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDateTimeRfc1123ValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDateTimeRfc1123ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + public Observable> getDateTimeRfc1123ValidAsync() { + return getDateTimeRfc1123ValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get date-time-rfc1123 dictionary value {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, DateTime> object + */ + public Observable>> getDateTimeRfc1123ValidWithServiceResponseAsync() { + return service.getDateTimeRfc1123Valid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getDateTimeRfc1123ValidDelegate(response); + Map body = null; + if (result.body() != null) { + body = new HashMap(); + for (Map.Entry entry : result.body().entrySet()) { + DateTime value; + value = entry.getValue().dateTime(); + body.put(entry.getKey(), value); + } + } + ServiceResponse> clientResponse = new ServiceResponse>(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDateTimeRfc1123ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param arrayBody the Map<String, DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDateTimeRfc1123Valid(Map arrayBody) { + putDateTimeRfc1123ValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param arrayBody the Map<String, DateTimeRfc1123> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDateTimeRfc1123ValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDateTimeRfc1123ValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param arrayBody the Map<String, DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDateTimeRfc1123ValidAsync(Map arrayBody) { + return putDateTimeRfc1123ValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value empty {"0": "Fri, 01 Dec 2000 00:00:01 GMT", "1": "Wed, 02 Jan 1980 00:11:35 GMT", "2": "Wed, 12 Oct 1492 10:15:01 GMT"}. + * + * @param arrayBody the Map<String, DateTimeRfc1123> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDateTimeRfc1123ValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + Map arrayBodyConverted = new HashMap(); + for (Map.Entry entry : arrayBody.entrySet()) { + DateTimeRfc1123 value = new DateTimeRfc1123(entry.getValue()); + arrayBodyConverted.put(entry.getKey(), value); + } + return service.putDateTimeRfc1123Valid(arrayBodyConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDateTimeRfc1123ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDateTimeRfc1123ValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Period> object if successful. + */ + public Map getDurationValid() { + return getDurationValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDurationValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDurationValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Period> object + */ + public Observable> getDurationValidAsync() { + return getDurationValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get duration dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Period> object + */ + public Observable>> getDurationValidWithServiceResponseAsync() { + return service.getDurationValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDurationValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDurationValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param arrayBody the Map<String, Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDurationValid(Map arrayBody) { + putDurationValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param arrayBody the Map<String, Period> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDurationValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDurationValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param arrayBody the Map<String, Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDurationValidAsync(Map arrayBody) { + return putDurationValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set dictionary value {"0": "P123DT22H14M12.011S", "1": "P5DT1H0M0S"}. + * + * @param arrayBody the Map<String, Period> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDurationValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDurationValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDurationValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDurationValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, byte[]> object if successful. + */ + public Map getByteValid() { + return getByteValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getByteValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getByteValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + public Observable> getByteValidAsync() { + return getByteValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each item encoded in base64. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + public Observable>> getByteValidWithServiceResponseAsync() { + return service.getByteValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getByteValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getByteValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put the dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each elementencoded in base 64. + * + * @param arrayBody the Map<String, byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putByteValid(Map arrayBody) { + putByteValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Put the dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each elementencoded in base 64. + * + * @param arrayBody the Map<String, byte[]> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putByteValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putByteValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Put the dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each elementencoded in base 64. + * + * @param arrayBody the Map<String, byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putByteValidAsync(Map arrayBody) { + return putByteValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put the dictionary value {"0": hex(FF FF FF FA), "1": hex(01 02 03), "2": hex (25, 29, 43)} with each elementencoded in base 64. + * + * @param arrayBody the Map<String, byte[]> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putByteValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putByteValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putByteValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putByteValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": null} with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, byte[]> object if successful. + */ + public Map getByteInvalidNull() { + return getByteInvalidNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": null} with the first item base64 encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getByteInvalidNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getByteInvalidNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": null} with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + public Observable> getByteInvalidNullAsync() { + return getByteInvalidNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get byte dictionary value {"0": hex(FF FF FF FA), "1": null} with the first item base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + public Observable>> getByteInvalidNullWithServiceResponseAsync() { + return service.getByteInvalidNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getByteInvalidNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getByteInvalidNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get base64url dictionary value {"0": "a string that gets encoded with base64url", "1": "test string", "2": "Lorem ipsum"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, byte[]> object if successful. + */ + public Map getBase64Url() { + return getBase64UrlWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get base64url dictionary value {"0": "a string that gets encoded with base64url", "1": "test string", "2": "Lorem ipsum"}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getBase64UrlAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getBase64UrlWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get base64url dictionary value {"0": "a string that gets encoded with base64url", "1": "test string", "2": "Lorem ipsum"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + public Observable> getBase64UrlAsync() { + return getBase64UrlWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get base64url dictionary value {"0": "a string that gets encoded with base64url", "1": "test string", "2": "Lorem ipsum"}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, byte[]> object + */ + public Observable>> getBase64UrlWithServiceResponseAsync() { + return service.getBase64Url() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = getBase64UrlDelegate(response); + Map body = null; + if (result.body() != null) { + body = new HashMap(); + for (Map.Entry entry : result.body().entrySet()) { + byte[] value; + value = entry.getValue().decodedBytes(); + body.put(entry.getKey(), value); + } + } + ServiceResponse> clientResponse = new ServiceResponse>(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getBase64UrlDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get dictionary of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + public Map getComplexNull() { + return getComplexNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get dictionary of complex type null value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get dictionary of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable> getComplexNullAsync() { + return getComplexNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get dictionary of complex type null value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable>> getComplexNullWithServiceResponseAsync() { + return service.getComplexNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get empty dictionary of complex type {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + public Map getComplexEmpty() { + return getComplexEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty dictionary of complex type {}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexEmptyAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty dictionary of complex type {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable> getComplexEmptyAsync() { + return getComplexEmptyWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get empty dictionary of complex type {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable>> getComplexEmptyWithServiceResponseAsync() { + return service.getComplexEmpty() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + public Map getComplexItemNull() { + return getComplexItemNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexItemNullAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexItemNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable> getComplexItemNullAsync() { + return getComplexItemNullWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get dictionary of complex type with null item {"0": {"integer": 1, "string": "2"}, "1": null, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable>> getComplexItemNullWithServiceResponseAsync() { + return service.getComplexItemNull() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexItemNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexItemNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + public Map getComplexItemEmpty() { + return getComplexItemEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexItemEmptyAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexItemEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable> getComplexItemEmptyAsync() { + return getComplexItemEmptyWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get dictionary of complex type with empty item {"0": {"integer": 1, "string": "2"}, "1:" {}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable>> getComplexItemEmptyWithServiceResponseAsync() { + return service.getComplexItemEmpty() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexItemEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexItemEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Widget> object if successful. + */ + public Map getComplexValid() { + return getComplexValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getComplexValidAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getComplexValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable> getComplexValidAsync() { + return getComplexValidWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get dictionary of complex type with {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Widget> object + */ + public Observable>> getComplexValidWithServiceResponseAsync() { + return service.getComplexValid() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getComplexValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getComplexValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param arrayBody the Map<String, Widget> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putComplexValid(Map arrayBody) { + putComplexValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param arrayBody the Map<String, Widget> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putComplexValidAsync(Map arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putComplexValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param arrayBody the Map<String, Widget> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putComplexValidAsync(Map arrayBody) { + return putComplexValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put an dictionary of complex type with values {"0": {"integer": 1, "string": "2"}, "1": {"integer": 3, "string": "4"}, "2": {"integer": 5, "string": "6"}}. + * + * @param arrayBody the Map<String, Widget> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putComplexValidWithServiceResponseAsync(Map arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putComplexValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putComplexValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putComplexValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + public Map> getArrayNull() { + return getArrayNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a null array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayNullAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>> getArrayNullAsync() { + return getArrayNullWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get a null array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>>> getArrayNullWithServiceResponseAsync() { + return service.getArrayNull() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an empty dictionary {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + public Map> getArrayEmpty() { + return getArrayEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an empty dictionary {}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayEmptyAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an empty dictionary {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>> getArrayEmptyAsync() { + return getArrayEmptyWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an empty dictionary {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>>> getArrayEmptyWithServiceResponseAsync() { + return service.getArrayEmpty() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an dictionary of array of strings {"0": ["1", "2", "3"], "1": null, "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + public Map> getArrayItemNull() { + return getArrayItemNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an dictionary of array of strings {"0": ["1", "2", "3"], "1": null, "2": ["7", "8", "9"]}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayItemNullAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayItemNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an dictionary of array of strings {"0": ["1", "2", "3"], "1": null, "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>> getArrayItemNullAsync() { + return getArrayItemNullWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an dictionary of array of strings {"0": ["1", "2", "3"], "1": null, "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>>> getArrayItemNullWithServiceResponseAsync() { + return service.getArrayItemNull() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayItemNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayItemNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of array of strings [{"0": ["1", "2", "3"], "1": [], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + public Map> getArrayItemEmpty() { + return getArrayItemEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of array of strings [{"0": ["1", "2", "3"], "1": [], "2": ["7", "8", "9"]}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayItemEmptyAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayItemEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of array of strings [{"0": ["1", "2", "3"], "1": [], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>> getArrayItemEmptyAsync() { + return getArrayItemEmptyWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of array of strings [{"0": ["1", "2", "3"], "1": [], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>>> getArrayItemEmptyWithServiceResponseAsync() { + return service.getArrayItemEmpty() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayItemEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayItemEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, List<String>> object if successful. + */ + public Map> getArrayValid() { + return getArrayValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getArrayValidAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getArrayValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>> getArrayValidAsync() { + return getArrayValidWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, List<String>> object + */ + public Observable>>> getArrayValidWithServiceResponseAsync() { + return service.getArrayValid() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getArrayValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getArrayValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put An array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param arrayBody the Map<String, List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putArrayValid(Map> arrayBody) { + putArrayValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Put An array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param arrayBody the Map<String, List<String>> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putArrayValidAsync(Map> arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putArrayValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Put An array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param arrayBody the Map<String, List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putArrayValidAsync(Map> arrayBody) { + return putArrayValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put An array of array of strings {"0": ["1", "2", "3"], "1": ["4", "5", "6"], "2": ["7", "8", "9"]}. + * + * @param arrayBody the Map<String, List<String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putArrayValidWithServiceResponseAsync(Map> arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putArrayValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putArrayValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putArrayValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an dictionaries of dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + public Map> getDictionaryNull() { + return getDictionaryNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an dictionaries of dictionaries with value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryNullAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an dictionaries of dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>> getDictionaryNullAsync() { + return getDictionaryNullWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an dictionaries of dictionaries with value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>>> getDictionaryNullWithServiceResponseAsync() { + return service.getDictionaryNull() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + public Map> getDictionaryEmpty() { + return getDictionaryEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryEmptyAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>> getDictionaryEmptyAsync() { + return getDictionaryEmptyWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>>> getDictionaryEmptyWithServiceResponseAsync() { + return service.getDictionaryEmpty() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": null, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + public Map> getDictionaryItemNull() { + return getDictionaryItemNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": null, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryItemNullAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryItemNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": null, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>> getDictionaryItemNullAsync() { + return getDictionaryItemNullWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": null, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>>> getDictionaryItemNullWithServiceResponseAsync() { + return service.getDictionaryItemNull() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryItemNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryItemNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + public Map> getDictionaryItemEmpty() { + return getDictionaryItemEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryItemEmptyAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryItemEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>> getDictionaryItemEmptyAsync() { + return getDictionaryItemEmptyWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>>> getDictionaryItemEmptyWithServiceResponseAsync() { + return service.getDictionaryItemEmpty() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryItemEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryItemEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Map<String, String>> object if successful. + */ + public Map> getDictionaryValid() { + return getDictionaryValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture>> getDictionaryValidAsync(final ServiceCallback>> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>> getDictionaryValidAsync() { + return getDictionaryValidWithServiceResponseAsync().map(new Func1>>, Map>>() { + @Override + public Map> call(ServiceResponse>> response) { + return response.body(); + } + }); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Map<String, String>> object + */ + public Observable>>> getDictionaryValidWithServiceResponseAsync() { + return service.getDictionaryValid() + .flatMap(new Func1, Observable>>>>() { + @Override + public Observable>>> call(Response response) { + try { + ServiceResponse>> clientResponse = getDictionaryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse>> getDictionaryValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().>, ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param arrayBody the Map<String, Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDictionaryValid(Map> arrayBody) { + putDictionaryValidWithServiceResponseAsync(arrayBody).toBlocking().single().body(); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param arrayBody the Map<String, Map<String, String>> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDictionaryValidAsync(Map> arrayBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDictionaryValidWithServiceResponseAsync(arrayBody), serviceCallback); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param arrayBody the Map<String, Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDictionaryValidAsync(Map> arrayBody) { + return putDictionaryValidWithServiceResponseAsync(arrayBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an dictionaries of dictionaries of type <string, string> with value {"0": {"1": "one", "2": "two", "3": "three"}, "1": {"4": "four", "5": "five", "6": "six"}, "2": {"7": "seven", "8": "eight", "9": "nine"}}. + * + * @param arrayBody the Map<String, Map<String, String>> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDictionaryValidWithServiceResponseAsync(Map> arrayBody) { + if (arrayBody == null) { + throw new IllegalArgumentException("Parameter arrayBody is required and cannot be null."); + } + Validator.validate(arrayBody); + return service.putDictionaryValid(arrayBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDictionaryValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDictionaryValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/package-info.java new file mode 100644 index 0000000000..bc173a6b15 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestSwaggerBATdictionaryService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodydictionary.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/models/Error.java b/test/vanilla/src/main/java/fixtures/bodydictionary/models/Error.java new file mode 100644 index 0000000000..09d234ef4a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydictionary.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodydictionary/models/ErrorException.java new file mode 100644 index 0000000000..1c9e29cdc0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydictionary.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/models/Widget.java b/test/vanilla/src/main/java/fixtures/bodydictionary/models/Widget.java new file mode 100644 index 0000000000..81c0343f51 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/models/Widget.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodydictionary.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Widget model. + */ +public class Widget { + /** + * The integer property. + */ + @JsonProperty(value = "integer") + private Integer integer; + + /** + * The stringProperty property. + */ + @JsonProperty(value = "string") + private String stringProperty; + + /** + * Get the integer value. + * + * @return the integer value + */ + public Integer integer() { + return this.integer; + } + + /** + * Set the integer value. + * + * @param integer the integer value to set + * @return the Widget object itself. + */ + public Widget withInteger(Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get the stringProperty value. + * + * @return the stringProperty value + */ + public String stringProperty() { + return this.stringProperty; + } + + /** + * Set the stringProperty value. + * + * @param stringProperty the stringProperty value to set + * @return the Widget object itself. + */ + public Widget withStringProperty(String stringProperty) { + this.stringProperty = stringProperty; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodydictionary/models/package-info.java new file mode 100644 index 0000000000..0dac2d0375 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestSwaggerBATdictionaryService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodydictionary.models; diff --git a/test/vanilla/src/main/java/fixtures/bodydictionary/package-info.java b/test/vanilla/src/main/java/fixtures/bodydictionary/package-info.java new file mode 100644 index 0000000000..991092c459 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodydictionary/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestSwaggerBATdictionaryService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodydictionary; diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/AutoRestDurationTestService.java b/test/vanilla/src/main/java/fixtures/bodyduration/AutoRestDurationTestService.java new file mode 100644 index 0000000000..8443d4c9de --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/AutoRestDurationTestService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyduration; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestDurationTestService class. + */ +public interface AutoRestDurationTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "https://localhost"; + + /** + * Gets the Durations object to access its operations. + * @return the Durations object. + */ + Durations durations(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/Durations.java b/test/vanilla/src/main/java/fixtures/bodyduration/Durations.java new file mode 100644 index 0000000000..4e518faa5e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/Durations.java @@ -0,0 +1,169 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyduration; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyduration.models.ErrorException; +import java.io.IOException; +import org.joda.time.Period; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Durations. + */ +public interface Durations { + /** + * Get null duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Period object if successful. + */ + Period getNull(); + + /** + * Get null duration value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + Observable getNullAsync(); + + /** + * Get null duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Put a positive duration value. + * + * @param durationBody the Period value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putPositiveDuration(Period durationBody); + + /** + * Put a positive duration value. + * + * @param durationBody the Period value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putPositiveDurationAsync(Period durationBody, final ServiceCallback serviceCallback); + + /** + * Put a positive duration value. + * + * @param durationBody the Period value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putPositiveDurationAsync(Period durationBody); + + /** + * Put a positive duration value. + * + * @param durationBody the Period value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putPositiveDurationWithServiceResponseAsync(Period durationBody); + + /** + * Get a positive duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Period object if successful. + */ + Period getPositiveDuration(); + + /** + * Get a positive duration value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getPositiveDurationAsync(final ServiceCallback serviceCallback); + + /** + * Get a positive duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + Observable getPositiveDurationAsync(); + + /** + * Get a positive duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + Observable> getPositiveDurationWithServiceResponseAsync(); + + /** + * Get an invalid duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Period object if successful. + */ + Period getInvalid(); + + /** + * Get an invalid duration value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback); + + /** + * Get an invalid duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + Observable getInvalidAsync(); + + /** + * Get an invalid duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + Observable> getInvalidWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/implementation/AutoRestDurationTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodyduration/implementation/AutoRestDurationTestServiceImpl.java new file mode 100644 index 0000000000..e76485e52c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/implementation/AutoRestDurationTestServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyduration.implementation; + +import fixtures.bodyduration.AutoRestDurationTestService; +import fixtures.bodyduration.Durations; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestDurationTestService class. + */ +public class AutoRestDurationTestServiceImpl extends ServiceClient implements AutoRestDurationTestService { + + /** + * The Durations object to access its operations. + */ + private Durations durations; + + /** + * Gets the Durations object to access its operations. + * @return the Durations object. + */ + public Durations durations() { + return this.durations; + } + + /** + * Initializes an instance of AutoRestDurationTestService client. + */ + public AutoRestDurationTestServiceImpl() { + this("https://localhost"); + } + + /** + * Initializes an instance of AutoRestDurationTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestDurationTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestDurationTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestDurationTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("https://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestDurationTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestDurationTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestDurationTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestDurationTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.durations = new DurationsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/implementation/DurationsImpl.java b/test/vanilla/src/main/java/fixtures/bodyduration/implementation/DurationsImpl.java new file mode 100644 index 0000000000..eff87e0920 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/implementation/DurationsImpl.java @@ -0,0 +1,345 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyduration.implementation; + +import retrofit2.Retrofit; +import fixtures.bodyduration.Durations; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyduration.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import org.joda.time.Period; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Durations. + */ +public class DurationsImpl implements Durations { + /** The Retrofit service to perform REST calls. */ + private DurationsService service; + /** The service client containing this operation class. */ + private AutoRestDurationTestServiceImpl client; + + /** + * Initializes an instance of Durations. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DurationsImpl(Retrofit retrofit, AutoRestDurationTestServiceImpl client) { + this.service = retrofit.create(DurationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Durations to be + * used by Retrofit to perform actually REST calls. + */ + interface DurationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyduration.Durations getNull" }) + @GET("duration/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyduration.Durations putPositiveDuration" }) + @PUT("duration/positiveduration") + Observable> putPositiveDuration(@Body Period durationBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyduration.Durations getPositiveDuration" }) + @GET("duration/positiveduration") + Observable> getPositiveDuration(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyduration.Durations getInvalid" }) + @GET("duration/invalid") + Observable> getInvalid(); + + } + + /** + * Get null duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Period object if successful. + */ + public Period getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null duration value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, Period>() { + @Override + public Period call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put a positive duration value. + * + * @param durationBody the Period value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putPositiveDuration(Period durationBody) { + putPositiveDurationWithServiceResponseAsync(durationBody).toBlocking().single().body(); + } + + /** + * Put a positive duration value. + * + * @param durationBody the Period value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putPositiveDurationAsync(Period durationBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putPositiveDurationWithServiceResponseAsync(durationBody), serviceCallback); + } + + /** + * Put a positive duration value. + * + * @param durationBody the Period value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putPositiveDurationAsync(Period durationBody) { + return putPositiveDurationWithServiceResponseAsync(durationBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put a positive duration value. + * + * @param durationBody the Period value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putPositiveDurationWithServiceResponseAsync(Period durationBody) { + if (durationBody == null) { + throw new IllegalArgumentException("Parameter durationBody is required and cannot be null."); + } + return service.putPositiveDuration(durationBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putPositiveDurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putPositiveDurationDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a positive duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Period object if successful. + */ + public Period getPositiveDuration() { + return getPositiveDurationWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a positive duration value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getPositiveDurationAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPositiveDurationWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a positive duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + public Observable getPositiveDurationAsync() { + return getPositiveDurationWithServiceResponseAsync().map(new Func1, Period>() { + @Override + public Period call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a positive duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + public Observable> getPositiveDurationWithServiceResponseAsync() { + return service.getPositiveDuration() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPositiveDurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPositiveDurationDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an invalid duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Period object if successful. + */ + public Period getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an invalid duration value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an invalid duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + public Observable getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1, Period>() { + @Override + public Period call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an invalid duration value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Period object + */ + public Observable> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodyduration/implementation/package-info.java new file mode 100644 index 0000000000..559836e1c4 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestDurationTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyduration.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/models/Error.java b/test/vanilla/src/main/java/fixtures/bodyduration/models/Error.java new file mode 100644 index 0000000000..82545b0209 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyduration.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodyduration/models/ErrorException.java new file mode 100644 index 0000000000..f35f2b61b7 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyduration.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodyduration/models/package-info.java new file mode 100644 index 0000000000..e6156cf72a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestDurationTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyduration.models; diff --git a/test/vanilla/src/main/java/fixtures/bodyduration/package-info.java b/test/vanilla/src/main/java/fixtures/bodyduration/package-info.java new file mode 100644 index 0000000000..554a9907ef --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyduration/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestDurationTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyduration; diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/AutoRestSwaggerBATFileService.java b/test/vanilla/src/main/java/fixtures/bodyfile/AutoRestSwaggerBATFileService.java new file mode 100644 index 0000000000..83bce6ab0c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/AutoRestSwaggerBATFileService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyfile; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestSwaggerBATFileService class. + */ +public interface AutoRestSwaggerBATFileService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Files object to access its operations. + * @return the Files object. + */ + Files files(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/Files.java b/test/vanilla/src/main/java/fixtures/bodyfile/Files.java new file mode 100644 index 0000000000..662b1a4ffc --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/Files.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyfile; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyfile.models.ErrorException; +import java.io.InputStream; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Files. + */ +public interface Files { + /** + * Get file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + InputStream getFile(); + + /** + * Get file. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getFileAsync(final ServiceCallback serviceCallback); + + /** + * Get file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable getFileAsync(); + + /** + * Get file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable> getFileWithServiceResponseAsync(); + + /** + * Get a large file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + InputStream getFileLarge(); + + /** + * Get a large file. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getFileLargeAsync(final ServiceCallback serviceCallback); + + /** + * Get a large file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable getFileLargeAsync(); + + /** + * Get a large file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable> getFileLargeWithServiceResponseAsync(); + + /** + * Get empty file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + InputStream getEmptyFile(); + + /** + * Get empty file. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyFileAsync(final ServiceCallback serviceCallback); + + /** + * Get empty file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable getEmptyFileAsync(); + + /** + * Get empty file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable> getEmptyFileWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/implementation/AutoRestSwaggerBATFileServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodyfile/implementation/AutoRestSwaggerBATFileServiceImpl.java new file mode 100644 index 0000000000..e460e15f0b --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/implementation/AutoRestSwaggerBATFileServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyfile.implementation; + +import fixtures.bodyfile.AutoRestSwaggerBATFileService; +import fixtures.bodyfile.Files; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestSwaggerBATFileService class. + */ +public class AutoRestSwaggerBATFileServiceImpl extends ServiceClient implements AutoRestSwaggerBATFileService { + + /** + * The Files object to access its operations. + */ + private Files files; + + /** + * Gets the Files object to access its operations. + * @return the Files object. + */ + public Files files() { + return this.files; + } + + /** + * Initializes an instance of AutoRestSwaggerBATFileService client. + */ + public AutoRestSwaggerBATFileServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestSwaggerBATFileService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestSwaggerBATFileServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATFileService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATFileServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATFileService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATFileServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATFileService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestSwaggerBATFileServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.files = new FilesImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/implementation/FilesImpl.java b/test/vanilla/src/main/java/fixtures/bodyfile/implementation/FilesImpl.java new file mode 100644 index 0000000000..20e6fd8114 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/implementation/FilesImpl.java @@ -0,0 +1,271 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyfile.implementation; + +import retrofit2.Retrofit; +import fixtures.bodyfile.Files; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyfile.models.ErrorException; +import java.io.InputStream; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.Streaming; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Files. + */ +public class FilesImpl implements Files { + /** The Retrofit service to perform REST calls. */ + private FilesService service; + /** The service client containing this operation class. */ + private AutoRestSwaggerBATFileServiceImpl client; + + /** + * Initializes an instance of Files. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FilesImpl(Retrofit retrofit, AutoRestSwaggerBATFileServiceImpl client) { + this.service = retrofit.create(FilesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Files to be + * used by Retrofit to perform actually REST calls. + */ + interface FilesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyfile.Files getFile" }) + @GET("files/stream/nonempty") + @Streaming + Observable> getFile(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyfile.Files getFileLarge" }) + @GET("files/stream/verylarge") + @Streaming + Observable> getFileLarge(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyfile.Files getEmptyFile" }) + @GET("files/stream/empty") + @Streaming + Observable> getEmptyFile(); + + } + + /** + * Get file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + public InputStream getFile() { + return getFileWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get file. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFileAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFileWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable getFileAsync() { + return getFileWithServiceResponseAsync().map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable> getFileWithServiceResponseAsync() { + return service.getFile() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getFileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getFileDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a large file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + public InputStream getFileLarge() { + return getFileLargeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a large file. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getFileLargeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getFileLargeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a large file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable getFileLargeAsync() { + return getFileLargeWithServiceResponseAsync().map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a large file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable> getFileLargeWithServiceResponseAsync() { + return service.getFileLarge() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getFileLargeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getFileLargeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get empty file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + public InputStream getEmptyFile() { + return getEmptyFileWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty file. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyFileAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyFileWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable getEmptyFileAsync() { + return getEmptyFileWithServiceResponseAsync().map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get empty file. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable> getEmptyFileWithServiceResponseAsync() { + return service.getEmptyFile() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyFileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyFileDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodyfile/implementation/package-info.java new file mode 100644 index 0000000000..9133b36958 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestSwaggerBATFileService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyfile.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/models/Error.java b/test/vanilla/src/main/java/fixtures/bodyfile/models/Error.java new file mode 100644 index 0000000000..b6ba2c3b69 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyfile.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodyfile/models/ErrorException.java new file mode 100644 index 0000000000..b9f78dc517 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyfile.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodyfile/models/package-info.java new file mode 100644 index 0000000000..e23a8a3cf3 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestSwaggerBATFileService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyfile.models; diff --git a/test/vanilla/src/main/java/fixtures/bodyfile/package-info.java b/test/vanilla/src/main/java/fixtures/bodyfile/package-info.java new file mode 100644 index 0000000000..51f457c7d4 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyfile/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestSwaggerBATFileService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyfile; diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/AutoRestSwaggerBATFormDataService.java b/test/vanilla/src/main/java/fixtures/bodyformdata/AutoRestSwaggerBATFormDataService.java new file mode 100644 index 0000000000..4ce708f4ef --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/AutoRestSwaggerBATFormDataService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyformdata; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestSwaggerBATFormDataService class. + */ +public interface AutoRestSwaggerBATFormDataService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Formdatas object to access its operations. + * @return the Formdatas object. + */ + Formdatas formdatas(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/Formdatas.java b/test/vanilla/src/main/java/fixtures/bodyformdata/Formdatas.java new file mode 100644 index 0000000000..32a9a4473e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/Formdatas.java @@ -0,0 +1,108 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyformdata; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyformdata.models.ErrorException; +import java.io.InputStream; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Formdatas. + */ +public interface Formdatas { + /** + * Upload file. + * + * @param fileContent File to upload. + * @param fileName File name to upload. Name has to be spelled exactly as written here. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + InputStream uploadFile(byte[] fileContent, String fileName); + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param fileName File name to upload. Name has to be spelled exactly as written here. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture uploadFileAsync(byte[] fileContent, String fileName, final ServiceCallback serviceCallback); + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param fileName File name to upload. Name has to be spelled exactly as written here. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable uploadFileAsync(byte[] fileContent, String fileName); + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param fileName File name to upload. Name has to be spelled exactly as written here. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable> uploadFileWithServiceResponseAsync(byte[] fileContent, String fileName); + + /** + * Upload file. + * + * @param fileContent File to upload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + InputStream uploadFileViaBody(byte[] fileContent); + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture uploadFileViaBodyAsync(byte[] fileContent, final ServiceCallback serviceCallback); + + /** + * Upload file. + * + * @param fileContent File to upload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable uploadFileViaBodyAsync(byte[] fileContent); + + /** + * Upload file. + * + * @param fileContent File to upload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + Observable> uploadFileViaBodyWithServiceResponseAsync(byte[] fileContent); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/AutoRestSwaggerBATFormDataServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/AutoRestSwaggerBATFormDataServiceImpl.java new file mode 100644 index 0000000000..05c55a0c0f --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/AutoRestSwaggerBATFormDataServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyformdata.implementation; + +import fixtures.bodyformdata.AutoRestSwaggerBATFormDataService; +import fixtures.bodyformdata.Formdatas; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestSwaggerBATFormDataService class. + */ +public class AutoRestSwaggerBATFormDataServiceImpl extends ServiceClient implements AutoRestSwaggerBATFormDataService { + + /** + * The Formdatas object to access its operations. + */ + private Formdatas formdatas; + + /** + * Gets the Formdatas object to access its operations. + * @return the Formdatas object. + */ + public Formdatas formdatas() { + return this.formdatas; + } + + /** + * Initializes an instance of AutoRestSwaggerBATFormDataService client. + */ + public AutoRestSwaggerBATFormDataServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestSwaggerBATFormDataService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestSwaggerBATFormDataServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATFormDataService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATFormDataServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATFormDataService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATFormDataServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATFormDataService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestSwaggerBATFormDataServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.formdatas = new FormdatasImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/FormdatasImpl.java b/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/FormdatasImpl.java new file mode 100644 index 0000000000..fc742e22ae --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/FormdatasImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyformdata.implementation; + +import retrofit2.Retrofit; +import fixtures.bodyformdata.Formdatas; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyformdata.models.ErrorException; +import java.io.InputStream; +import java.io.IOException; +import okhttp3.MediaType; +import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Headers; +import retrofit2.http.Multipart; +import retrofit2.http.Part; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Streaming; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Formdatas. + */ +public class FormdatasImpl implements Formdatas { + /** The Retrofit service to perform REST calls. */ + private FormdatasService service; + /** The service client containing this operation class. */ + private AutoRestSwaggerBATFormDataServiceImpl client; + + /** + * Initializes an instance of Formdatas. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public FormdatasImpl(Retrofit retrofit, AutoRestSwaggerBATFormDataServiceImpl client) { + this.service = retrofit.create(FormdatasService.class); + this.client = client; + } + + /** + * The interface defining all the services for Formdatas to be + * used by Retrofit to perform actually REST calls. + */ + interface FormdatasService { + @Multipart + @POST("formdata/stream/uploadfile") + @Streaming + Observable> uploadFile(@Part("fileContent") RequestBody fileContent, @Part("fileName") String fileName); + + @Headers({ "Content-Type: application/octet-stream", "x-ms-logging-context: fixtures.bodyformdata.Formdatas uploadFileViaBody" }) + @PUT("formdata/stream/uploadfile") + @Streaming + Observable> uploadFileViaBody(@Body RequestBody fileContent); + + } + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param fileName File name to upload. Name has to be spelled exactly as written here. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + public InputStream uploadFile(byte[] fileContent, String fileName) { + return uploadFileWithServiceResponseAsync(fileContent, fileName).toBlocking().single().body(); + } + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param fileName File name to upload. Name has to be spelled exactly as written here. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture uploadFileAsync(byte[] fileContent, String fileName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(uploadFileWithServiceResponseAsync(fileContent, fileName), serviceCallback); + } + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param fileName File name to upload. Name has to be spelled exactly as written here. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable uploadFileAsync(byte[] fileContent, String fileName) { + return uploadFileWithServiceResponseAsync(fileContent, fileName).map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param fileName File name to upload. Name has to be spelled exactly as written here. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable> uploadFileWithServiceResponseAsync(byte[] fileContent, String fileName) { + if (fileContent == null) { + throw new IllegalArgumentException("Parameter fileContent is required and cannot be null."); + } + if (fileName == null) { + throw new IllegalArgumentException("Parameter fileName is required and cannot be null."); + } + RequestBody fileContentConverted = RequestBody.create(MediaType.parse("multipart/form-data"), fileContent); + return service.uploadFile(fileContentConverted, fileName) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = uploadFileDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse uploadFileDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Upload file. + * + * @param fileContent File to upload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the InputStream object if successful. + */ + public InputStream uploadFileViaBody(byte[] fileContent) { + return uploadFileViaBodyWithServiceResponseAsync(fileContent).toBlocking().single().body(); + } + + /** + * Upload file. + * + * @param fileContent File to upload. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture uploadFileViaBodyAsync(byte[] fileContent, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(uploadFileViaBodyWithServiceResponseAsync(fileContent), serviceCallback); + } + + /** + * Upload file. + * + * @param fileContent File to upload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable uploadFileViaBodyAsync(byte[] fileContent) { + return uploadFileViaBodyWithServiceResponseAsync(fileContent).map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Upload file. + * + * @param fileContent File to upload. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the InputStream object + */ + public Observable> uploadFileViaBodyWithServiceResponseAsync(byte[] fileContent) { + if (fileContent == null) { + throw new IllegalArgumentException("Parameter fileContent is required and cannot be null."); + } + RequestBody fileContentConverted = RequestBody.create(MediaType.parse("application/octet-stream"), fileContent); + return service.uploadFileViaBody(fileContentConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = uploadFileViaBodyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse uploadFileViaBodyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/package-info.java new file mode 100644 index 0000000000..fe7fa17669 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestSwaggerBATFormDataService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyformdata.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/models/Error.java b/test/vanilla/src/main/java/fixtures/bodyformdata/models/Error.java new file mode 100644 index 0000000000..8122b0d34c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyformdata.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodyformdata/models/ErrorException.java new file mode 100644 index 0000000000..5ca77de848 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyformdata.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodyformdata/models/package-info.java new file mode 100644 index 0000000000..c3af409bee --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestSwaggerBATFormDataService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyformdata.models; diff --git a/test/vanilla/src/main/java/fixtures/bodyformdata/package-info.java b/test/vanilla/src/main/java/fixtures/bodyformdata/package-info.java new file mode 100644 index 0000000000..e747985f5c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyformdata/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestSwaggerBATFormDataService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodyformdata; diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/AutoRestIntegerTestService.java b/test/vanilla/src/main/java/fixtures/bodyinteger/AutoRestIntegerTestService.java new file mode 100644 index 0000000000..d29fd3d17d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/AutoRestIntegerTestService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyinteger; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestIntegerTestService class. + */ +public interface AutoRestIntegerTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Ints object to access its operations. + * @return the Ints object. + */ + Ints ints(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/Ints.java b/test/vanilla/src/main/java/fixtures/bodyinteger/Ints.java new file mode 100644 index 0000000000..f7b3a80b5d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/Ints.java @@ -0,0 +1,531 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyinteger; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyinteger.models.ErrorException; +import java.io.IOException; +import org.joda.time.DateTime; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Ints. + */ +public interface Ints { + /** + * Get null Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getNull(); + + /** + * Get null Int value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getNullAsync(); + + /** + * Get null Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get invalid Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getInvalid(); + + /** + * Get invalid Int value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getInvalidAsync(); + + /** + * Get invalid Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getInvalidWithServiceResponseAsync(); + + /** + * Get overflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getOverflowInt32(); + + /** + * Get overflow Int32 value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getOverflowInt32Async(final ServiceCallback serviceCallback); + + /** + * Get overflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getOverflowInt32Async(); + + /** + * Get overflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getOverflowInt32WithServiceResponseAsync(); + + /** + * Get underflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + int getUnderflowInt32(); + + /** + * Get underflow Int32 value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUnderflowInt32Async(final ServiceCallback serviceCallback); + + /** + * Get underflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable getUnderflowInt32Async(); + + /** + * Get underflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the int object + */ + Observable> getUnderflowInt32WithServiceResponseAsync(); + + /** + * Get overflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the long object if successful. + */ + long getOverflowInt64(); + + /** + * Get overflow Int64 value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getOverflowInt64Async(final ServiceCallback serviceCallback); + + /** + * Get overflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the long object + */ + Observable getOverflowInt64Async(); + + /** + * Get overflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the long object + */ + Observable> getOverflowInt64WithServiceResponseAsync(); + + /** + * Get underflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the long object if successful. + */ + long getUnderflowInt64(); + + /** + * Get underflow Int64 value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUnderflowInt64Async(final ServiceCallback serviceCallback); + + /** + * Get underflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the long object + */ + Observable getUnderflowInt64Async(); + + /** + * Get underflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the long object + */ + Observable> getUnderflowInt64WithServiceResponseAsync(); + + /** + * Put max int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putMax32(int intBody); + + /** + * Put max int32 value. + * + * @param intBody the int value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putMax32Async(int intBody, final ServiceCallback serviceCallback); + + /** + * Put max int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putMax32Async(int intBody); + + /** + * Put max int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putMax32WithServiceResponseAsync(int intBody); + + /** + * Put max int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putMax64(long intBody); + + /** + * Put max int64 value. + * + * @param intBody the long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putMax64Async(long intBody, final ServiceCallback serviceCallback); + + /** + * Put max int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putMax64Async(long intBody); + + /** + * Put max int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putMax64WithServiceResponseAsync(long intBody); + + /** + * Put min int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putMin32(int intBody); + + /** + * Put min int32 value. + * + * @param intBody the int value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putMin32Async(int intBody, final ServiceCallback serviceCallback); + + /** + * Put min int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putMin32Async(int intBody); + + /** + * Put min int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putMin32WithServiceResponseAsync(int intBody); + + /** + * Put min int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putMin64(long intBody); + + /** + * Put min int64 value. + * + * @param intBody the long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putMin64Async(long intBody, final ServiceCallback serviceCallback); + + /** + * Put min int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putMin64Async(long intBody); + + /** + * Put min int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putMin64WithServiceResponseAsync(long intBody); + + /** + * Get datetime encoded as Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getUnixTime(); + + /** + * Get datetime encoded as Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getUnixTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get datetime encoded as Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getUnixTimeAsync(); + + /** + * Get datetime encoded as Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getUnixTimeWithServiceResponseAsync(); + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putUnixTimeDate(DateTime intBody); + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putUnixTimeDateAsync(DateTime intBody, final ServiceCallback serviceCallback); + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putUnixTimeDateAsync(DateTime intBody); + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putUnixTimeDateWithServiceResponseAsync(DateTime intBody); + + /** + * Get invalid Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getInvalidUnixTime(); + + /** + * Get invalid Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidUnixTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getInvalidUnixTimeAsync(); + + /** + * Get invalid Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getInvalidUnixTimeWithServiceResponseAsync(); + + /** + * Get null Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + DateTime getNullUnixTime(); + + /** + * Get null Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullUnixTimeAsync(final ServiceCallback serviceCallback); + + /** + * Get null Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable getNullUnixTimeAsync(); + + /** + * Get null Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + Observable> getNullUnixTimeWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/AutoRestIntegerTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/AutoRestIntegerTestServiceImpl.java new file mode 100644 index 0000000000..1f561393fb --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/AutoRestIntegerTestServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyinteger.implementation; + +import fixtures.bodyinteger.AutoRestIntegerTestService; +import fixtures.bodyinteger.Ints; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestIntegerTestService class. + */ +public class AutoRestIntegerTestServiceImpl extends ServiceClient implements AutoRestIntegerTestService { + + /** + * The Ints object to access its operations. + */ + private Ints ints; + + /** + * Gets the Ints object to access its operations. + * @return the Ints object. + */ + public Ints ints() { + return this.ints; + } + + /** + * Initializes an instance of AutoRestIntegerTestService client. + */ + public AutoRestIntegerTestServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestIntegerTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestIntegerTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestIntegerTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestIntegerTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestIntegerTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestIntegerTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestIntegerTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestIntegerTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.ints = new IntsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/IntsImpl.java b/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/IntsImpl.java new file mode 100644 index 0000000000..998ff56d4f --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/IntsImpl.java @@ -0,0 +1,1071 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyinteger.implementation; + +import retrofit2.Retrofit; +import fixtures.bodyinteger.Ints; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodyinteger.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Ints. + */ +public class IntsImpl implements Ints { + /** The Retrofit service to perform REST calls. */ + private IntsService service; + /** The service client containing this operation class. */ + private AutoRestIntegerTestServiceImpl client; + + /** + * Initializes an instance of Ints. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public IntsImpl(Retrofit retrofit, AutoRestIntegerTestServiceImpl client) { + this.service = retrofit.create(IntsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Ints to be + * used by Retrofit to perform actually REST calls. + */ + interface IntsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getNull" }) + @GET("int/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getInvalid" }) + @GET("int/invalid") + Observable> getInvalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getOverflowInt32" }) + @GET("int/overflowint32") + Observable> getOverflowInt32(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getUnderflowInt32" }) + @GET("int/underflowint32") + Observable> getUnderflowInt32(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getOverflowInt64" }) + @GET("int/overflowint64") + Observable> getOverflowInt64(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getUnderflowInt64" }) + @GET("int/underflowint64") + Observable> getUnderflowInt64(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints putMax32" }) + @PUT("int/max/32") + Observable> putMax32(@Body int intBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints putMax64" }) + @PUT("int/max/64") + Observable> putMax64(@Body long intBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints putMin32" }) + @PUT("int/min/32") + Observable> putMin32(@Body int intBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints putMin64" }) + @PUT("int/min/64") + Observable> putMin64(@Body long intBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getUnixTime" }) + @GET("int/unixtime") + Observable> getUnixTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints putUnixTimeDate" }) + @PUT("int/unixtime") + Observable> putUnixTimeDate(@Body long intBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getInvalidUnixTime" }) + @GET("int/invalidunixtime") + Observable> getInvalidUnixTime(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyinteger.Ints getNullUnixTime" }) + @GET("int/nullunixtime") + Observable> getNullUnixTime(); + + } + + /** + * Get null Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null Int value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getInvalid() { + return getInvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid Int value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getInvalidAsync() { + return getInvalidWithServiceResponseAsync().map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid Int value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getInvalidWithServiceResponseAsync() { + return service.getInvalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get overflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getOverflowInt32() { + return getOverflowInt32WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get overflow Int32 value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOverflowInt32Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOverflowInt32WithServiceResponseAsync(), serviceCallback); + } + + /** + * Get overflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getOverflowInt32Async() { + return getOverflowInt32WithServiceResponseAsync().map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get overflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getOverflowInt32WithServiceResponseAsync() { + return service.getOverflowInt32() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getOverflowInt32Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOverflowInt32Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get underflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the int object if successful. + */ + public int getUnderflowInt32() { + return getUnderflowInt32WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get underflow Int32 value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUnderflowInt32Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUnderflowInt32WithServiceResponseAsync(), serviceCallback); + } + + /** + * Get underflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable getUnderflowInt32Async() { + return getUnderflowInt32WithServiceResponseAsync().map(new Func1, Integer>() { + @Override + public Integer call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get underflow Int32 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Integer object + */ + public Observable> getUnderflowInt32WithServiceResponseAsync() { + return service.getUnderflowInt32() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUnderflowInt32Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUnderflowInt32Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get overflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the long object if successful. + */ + public long getOverflowInt64() { + return getOverflowInt64WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get overflow Int64 value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOverflowInt64Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOverflowInt64WithServiceResponseAsync(), serviceCallback); + } + + /** + * Get overflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Long object + */ + public Observable getOverflowInt64Async() { + return getOverflowInt64WithServiceResponseAsync().map(new Func1, Long>() { + @Override + public Long call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get overflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Long object + */ + public Observable> getOverflowInt64WithServiceResponseAsync() { + return service.getOverflowInt64() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getOverflowInt64Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOverflowInt64Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get underflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the long object if successful. + */ + public long getUnderflowInt64() { + return getUnderflowInt64WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get underflow Int64 value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUnderflowInt64Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUnderflowInt64WithServiceResponseAsync(), serviceCallback); + } + + /** + * Get underflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Long object + */ + public Observable getUnderflowInt64Async() { + return getUnderflowInt64WithServiceResponseAsync().map(new Func1, Long>() { + @Override + public Long call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get underflow Int64 value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Long object + */ + public Observable> getUnderflowInt64WithServiceResponseAsync() { + return service.getUnderflowInt64() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getUnderflowInt64Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUnderflowInt64Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put max int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putMax32(int intBody) { + putMax32WithServiceResponseAsync(intBody).toBlocking().single().body(); + } + + /** + * Put max int32 value. + * + * @param intBody the int value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putMax32Async(int intBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putMax32WithServiceResponseAsync(intBody), serviceCallback); + } + + /** + * Put max int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putMax32Async(int intBody) { + return putMax32WithServiceResponseAsync(intBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put max int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putMax32WithServiceResponseAsync(int intBody) { + return service.putMax32(intBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putMax32Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putMax32Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put max int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putMax64(long intBody) { + putMax64WithServiceResponseAsync(intBody).toBlocking().single().body(); + } + + /** + * Put max int64 value. + * + * @param intBody the long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putMax64Async(long intBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putMax64WithServiceResponseAsync(intBody), serviceCallback); + } + + /** + * Put max int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putMax64Async(long intBody) { + return putMax64WithServiceResponseAsync(intBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put max int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putMax64WithServiceResponseAsync(long intBody) { + return service.putMax64(intBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putMax64Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putMax64Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put min int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putMin32(int intBody) { + putMin32WithServiceResponseAsync(intBody).toBlocking().single().body(); + } + + /** + * Put min int32 value. + * + * @param intBody the int value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putMin32Async(int intBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putMin32WithServiceResponseAsync(intBody), serviceCallback); + } + + /** + * Put min int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putMin32Async(int intBody) { + return putMin32WithServiceResponseAsync(intBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put min int32 value. + * + * @param intBody the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putMin32WithServiceResponseAsync(int intBody) { + return service.putMin32(intBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putMin32Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putMin32Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put min int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putMin64(long intBody) { + putMin64WithServiceResponseAsync(intBody).toBlocking().single().body(); + } + + /** + * Put min int64 value. + * + * @param intBody the long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putMin64Async(long intBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putMin64WithServiceResponseAsync(intBody), serviceCallback); + } + + /** + * Put min int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putMin64Async(long intBody) { + return putMin64WithServiceResponseAsync(intBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put min int64 value. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putMin64WithServiceResponseAsync(long intBody) { + return service.putMin64(intBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putMin64Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putMin64Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get datetime encoded as Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getUnixTime() { + return getUnixTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get datetime encoded as Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getUnixTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getUnixTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get datetime encoded as Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getUnixTimeAsync() { + return getUnixTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get datetime encoded as Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getUnixTimeWithServiceResponseAsync() { + return service.getUnixTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getUnixTimeDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = new DateTime(result.body() * 1000L, DateTimeZone.UTC); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getUnixTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putUnixTimeDate(DateTime intBody) { + putUnixTimeDateWithServiceResponseAsync(intBody).toBlocking().single().body(); + } + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putUnixTimeDateAsync(DateTime intBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putUnixTimeDateWithServiceResponseAsync(intBody), serviceCallback); + } + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putUnixTimeDateAsync(DateTime intBody) { + return putUnixTimeDateWithServiceResponseAsync(intBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put datetime encoded as Unix time. + * + * @param intBody the long value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putUnixTimeDateWithServiceResponseAsync(DateTime intBody) { + Long intBodyConverted = intBody.toDateTime(DateTimeZone.UTC).getMillis() / 1000; + return service.putUnixTimeDate(intBodyConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putUnixTimeDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putUnixTimeDateDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getInvalidUnixTime() { + return getInvalidUnixTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidUnixTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidUnixTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getInvalidUnixTimeAsync() { + return getInvalidUnixTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getInvalidUnixTimeWithServiceResponseAsync() { + return service.getInvalidUnixTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getInvalidUnixTimeDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = new DateTime(result.body() * 1000L, DateTimeZone.UTC); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidUnixTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DateTime object if successful. + */ + public DateTime getNullUnixTime() { + return getNullUnixTimeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null Unix time value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullUnixTimeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullUnixTimeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable getNullUnixTimeAsync() { + return getNullUnixTimeWithServiceResponseAsync().map(new Func1, DateTime>() { + @Override + public DateTime call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null Unix time value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DateTime object + */ + public Observable> getNullUnixTimeWithServiceResponseAsync() { + return service.getNullUnixTime() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getNullUnixTimeDelegate(response); + DateTime body = null; + if (result.body() != null) { + body = new DateTime(result.body() * 1000L, DateTimeZone.UTC); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullUnixTimeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/package-info.java new file mode 100644 index 0000000000..51d1d53940 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestIntegerTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyinteger.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/models/Error.java b/test/vanilla/src/main/java/fixtures/bodyinteger/models/Error.java new file mode 100644 index 0000000000..fdfc568466 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyinteger.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodyinteger/models/ErrorException.java new file mode 100644 index 0000000000..cd1f712ecf --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodyinteger.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodyinteger/models/package-info.java new file mode 100644 index 0000000000..f47eb23f75 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestIntegerTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyinteger.models; diff --git a/test/vanilla/src/main/java/fixtures/bodyinteger/package-info.java b/test/vanilla/src/main/java/fixtures/bodyinteger/package-info.java new file mode 100644 index 0000000000..aca26630ca --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodyinteger/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestIntegerTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodyinteger; diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/AutoRestNumberTestService.java b/test/vanilla/src/main/java/fixtures/bodynumber/AutoRestNumberTestService.java new file mode 100644 index 0000000000..c8badc5e34 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/AutoRestNumberTestService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodynumber; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestNumberTestService class. + */ +public interface AutoRestNumberTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "https://localhost"; + + /** + * Gets the Numbers object to access its operations. + * @return the Numbers object. + */ + Numbers numbers(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/Numbers.java b/test/vanilla/src/main/java/fixtures/bodynumber/Numbers.java new file mode 100644 index 0000000000..f326e565e1 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/Numbers.java @@ -0,0 +1,896 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodynumber; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodynumber.models.ErrorException; +import java.io.IOException; +import java.math.BigDecimal; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Numbers. + */ +public interface Numbers { + /** + * Get null Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getNull(); + + /** + * Get null Number value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getNullAsync(); + + /** + * Get null Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Get invalid float Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getInvalidFloat(); + + /** + * Get invalid float Number value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidFloatAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid float Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getInvalidFloatAsync(); + + /** + * Get invalid float Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getInvalidFloatWithServiceResponseAsync(); + + /** + * Get invalid double Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getInvalidDouble(); + + /** + * Get invalid double Number value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidDoubleAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid double Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getInvalidDoubleAsync(); + + /** + * Get invalid double Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getInvalidDoubleWithServiceResponseAsync(); + + /** + * Get invalid decimal Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + BigDecimal getInvalidDecimal(); + + /** + * Get invalid decimal Number value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getInvalidDecimalAsync(final ServiceCallback serviceCallback); + + /** + * Get invalid decimal Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable getInvalidDecimalAsync(); + + /** + * Get invalid decimal Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable> getInvalidDecimalWithServiceResponseAsync(); + + /** + * Put big float value 3.402823e+20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBigFloat(double numberBody); + + /** + * Put big float value 3.402823e+20. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBigFloatAsync(double numberBody, final ServiceCallback serviceCallback); + + /** + * Put big float value 3.402823e+20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBigFloatAsync(double numberBody); + + /** + * Put big float value 3.402823e+20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBigFloatWithServiceResponseAsync(double numberBody); + + /** + * Get big float value 3.402823e+20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getBigFloat(); + + /** + * Get big float value 3.402823e+20. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBigFloatAsync(final ServiceCallback serviceCallback); + + /** + * Get big float value 3.402823e+20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getBigFloatAsync(); + + /** + * Get big float value 3.402823e+20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getBigFloatWithServiceResponseAsync(); + + /** + * Put big double value 2.5976931e+101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBigDouble(double numberBody); + + /** + * Put big double value 2.5976931e+101. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBigDoubleAsync(double numberBody, final ServiceCallback serviceCallback); + + /** + * Put big double value 2.5976931e+101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBigDoubleAsync(double numberBody); + + /** + * Put big double value 2.5976931e+101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBigDoubleWithServiceResponseAsync(double numberBody); + + /** + * Get big double value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getBigDouble(); + + /** + * Get big double value 2.5976931e+101. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBigDoubleAsync(final ServiceCallback serviceCallback); + + /** + * Get big double value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getBigDoubleAsync(); + + /** + * Get big double value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getBigDoubleWithServiceResponseAsync(); + + /** + * Put big double value 99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBigDoublePositiveDecimal(double numberBody); + + /** + * Put big double value 99999999.99. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBigDoublePositiveDecimalAsync(double numberBody, final ServiceCallback serviceCallback); + + /** + * Put big double value 99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBigDoublePositiveDecimalAsync(double numberBody); + + /** + * Put big double value 99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBigDoublePositiveDecimalWithServiceResponseAsync(double numberBody); + + /** + * Get big double value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getBigDoublePositiveDecimal(); + + /** + * Get big double value 99999999.99. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBigDoublePositiveDecimalAsync(final ServiceCallback serviceCallback); + + /** + * Get big double value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getBigDoublePositiveDecimalAsync(); + + /** + * Get big double value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getBigDoublePositiveDecimalWithServiceResponseAsync(); + + /** + * Put big double value -99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBigDoubleNegativeDecimal(double numberBody); + + /** + * Put big double value -99999999.99. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBigDoubleNegativeDecimalAsync(double numberBody, final ServiceCallback serviceCallback); + + /** + * Put big double value -99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBigDoubleNegativeDecimalAsync(double numberBody); + + /** + * Put big double value -99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBigDoubleNegativeDecimalWithServiceResponseAsync(double numberBody); + + /** + * Get big double value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getBigDoubleNegativeDecimal(); + + /** + * Get big double value -99999999.99. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBigDoubleNegativeDecimalAsync(final ServiceCallback serviceCallback); + + /** + * Get big double value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getBigDoubleNegativeDecimalAsync(); + + /** + * Get big double value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getBigDoubleNegativeDecimalWithServiceResponseAsync(); + + /** + * Put big decimal value 2.5976931e+101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBigDecimal(BigDecimal numberBody); + + /** + * Put big decimal value 2.5976931e+101. + * + * @param numberBody the BigDecimal value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBigDecimalAsync(BigDecimal numberBody, final ServiceCallback serviceCallback); + + /** + * Put big decimal value 2.5976931e+101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBigDecimalAsync(BigDecimal numberBody); + + /** + * Put big decimal value 2.5976931e+101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBigDecimalWithServiceResponseAsync(BigDecimal numberBody); + + /** + * Get big decimal value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + BigDecimal getBigDecimal(); + + /** + * Get big decimal value 2.5976931e+101. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBigDecimalAsync(final ServiceCallback serviceCallback); + + /** + * Get big decimal value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable getBigDecimalAsync(); + + /** + * Get big decimal value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable> getBigDecimalWithServiceResponseAsync(); + + /** + * Put big decimal value 99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBigDecimalPositiveDecimal(BigDecimal numberBody); + + /** + * Put big decimal value 99999999.99. + * + * @param numberBody the BigDecimal value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBigDecimalPositiveDecimalAsync(BigDecimal numberBody, final ServiceCallback serviceCallback); + + /** + * Put big decimal value 99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBigDecimalPositiveDecimalAsync(BigDecimal numberBody); + + /** + * Put big decimal value 99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBigDecimalPositiveDecimalWithServiceResponseAsync(BigDecimal numberBody); + + /** + * Get big decimal value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + BigDecimal getBigDecimalPositiveDecimal(); + + /** + * Get big decimal value 99999999.99. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBigDecimalPositiveDecimalAsync(final ServiceCallback serviceCallback); + + /** + * Get big decimal value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable getBigDecimalPositiveDecimalAsync(); + + /** + * Get big decimal value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable> getBigDecimalPositiveDecimalWithServiceResponseAsync(); + + /** + * Put big decimal value -99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBigDecimalNegativeDecimal(BigDecimal numberBody); + + /** + * Put big decimal value -99999999.99. + * + * @param numberBody the BigDecimal value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBigDecimalNegativeDecimalAsync(BigDecimal numberBody, final ServiceCallback serviceCallback); + + /** + * Put big decimal value -99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBigDecimalNegativeDecimalAsync(BigDecimal numberBody); + + /** + * Put big decimal value -99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBigDecimalNegativeDecimalWithServiceResponseAsync(BigDecimal numberBody); + + /** + * Get big decimal value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + BigDecimal getBigDecimalNegativeDecimal(); + + /** + * Get big decimal value -99999999.99. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBigDecimalNegativeDecimalAsync(final ServiceCallback serviceCallback); + + /** + * Get big decimal value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable getBigDecimalNegativeDecimalAsync(); + + /** + * Get big decimal value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable> getBigDecimalNegativeDecimalWithServiceResponseAsync(); + + /** + * Put small float value 3.402823e-20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putSmallFloat(double numberBody); + + /** + * Put small float value 3.402823e-20. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putSmallFloatAsync(double numberBody, final ServiceCallback serviceCallback); + + /** + * Put small float value 3.402823e-20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putSmallFloatAsync(double numberBody); + + /** + * Put small float value 3.402823e-20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putSmallFloatWithServiceResponseAsync(double numberBody); + + /** + * Get big double value 3.402823e-20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getSmallFloat(); + + /** + * Get big double value 3.402823e-20. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSmallFloatAsync(final ServiceCallback serviceCallback); + + /** + * Get big double value 3.402823e-20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getSmallFloatAsync(); + + /** + * Get big double value 3.402823e-20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getSmallFloatWithServiceResponseAsync(); + + /** + * Put small double value 2.5976931e-101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putSmallDouble(double numberBody); + + /** + * Put small double value 2.5976931e-101. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putSmallDoubleAsync(double numberBody, final ServiceCallback serviceCallback); + + /** + * Put small double value 2.5976931e-101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putSmallDoubleAsync(double numberBody); + + /** + * Put small double value 2.5976931e-101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putSmallDoubleWithServiceResponseAsync(double numberBody); + + /** + * Get big double value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + double getSmallDouble(); + + /** + * Get big double value 2.5976931e-101. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSmallDoubleAsync(final ServiceCallback serviceCallback); + + /** + * Get big double value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable getSmallDoubleAsync(); + + /** + * Get big double value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the double object + */ + Observable> getSmallDoubleWithServiceResponseAsync(); + + /** + * Put small decimal value 2.5976931e-101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putSmallDecimal(BigDecimal numberBody); + + /** + * Put small decimal value 2.5976931e-101. + * + * @param numberBody the BigDecimal value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putSmallDecimalAsync(BigDecimal numberBody, final ServiceCallback serviceCallback); + + /** + * Put small decimal value 2.5976931e-101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putSmallDecimalAsync(BigDecimal numberBody); + + /** + * Put small decimal value 2.5976931e-101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putSmallDecimalWithServiceResponseAsync(BigDecimal numberBody); + + /** + * Get small decimal value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + BigDecimal getSmallDecimal(); + + /** + * Get small decimal value 2.5976931e-101. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getSmallDecimalAsync(final ServiceCallback serviceCallback); + + /** + * Get small decimal value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable getSmallDecimalAsync(); + + /** + * Get small decimal value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + Observable> getSmallDecimalWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/implementation/AutoRestNumberTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodynumber/implementation/AutoRestNumberTestServiceImpl.java new file mode 100644 index 0000000000..345ac2527c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/implementation/AutoRestNumberTestServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodynumber.implementation; + +import fixtures.bodynumber.AutoRestNumberTestService; +import fixtures.bodynumber.Numbers; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestNumberTestService class. + */ +public class AutoRestNumberTestServiceImpl extends ServiceClient implements AutoRestNumberTestService { + + /** + * The Numbers object to access its operations. + */ + private Numbers numbers; + + /** + * Gets the Numbers object to access its operations. + * @return the Numbers object. + */ + public Numbers numbers() { + return this.numbers; + } + + /** + * Initializes an instance of AutoRestNumberTestService client. + */ + public AutoRestNumberTestServiceImpl() { + this("https://localhost"); + } + + /** + * Initializes an instance of AutoRestNumberTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestNumberTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestNumberTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestNumberTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("https://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestNumberTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestNumberTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestNumberTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestNumberTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.numbers = new NumbersImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/implementation/NumbersImpl.java b/test/vanilla/src/main/java/fixtures/bodynumber/implementation/NumbersImpl.java new file mode 100644 index 0000000000..188bcbaeac --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/implementation/NumbersImpl.java @@ -0,0 +1,1781 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodynumber.implementation; + +import retrofit2.Retrofit; +import fixtures.bodynumber.Numbers; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodynumber.models.ErrorException; +import java.io.IOException; +import java.math.BigDecimal; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Numbers. + */ +public class NumbersImpl implements Numbers { + /** The Retrofit service to perform REST calls. */ + private NumbersService service; + /** The service client containing this operation class. */ + private AutoRestNumberTestServiceImpl client; + + /** + * Initializes an instance of Numbers. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NumbersImpl(Retrofit retrofit, AutoRestNumberTestServiceImpl client) { + this.service = retrofit.create(NumbersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Numbers to be + * used by Retrofit to perform actually REST calls. + */ + interface NumbersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getNull" }) + @GET("number/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getInvalidFloat" }) + @GET("number/invalidfloat") + Observable> getInvalidFloat(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getInvalidDouble" }) + @GET("number/invaliddouble") + Observable> getInvalidDouble(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getInvalidDecimal" }) + @GET("number/invaliddecimal") + Observable> getInvalidDecimal(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putBigFloat" }) + @PUT("number/big/float/3.402823e+20") + Observable> putBigFloat(@Body double numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getBigFloat" }) + @GET("number/big/float/3.402823e+20") + Observable> getBigFloat(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putBigDouble" }) + @PUT("number/big/double/2.5976931e+101") + Observable> putBigDouble(@Body double numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getBigDouble" }) + @GET("number/big/double/2.5976931e+101") + Observable> getBigDouble(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putBigDoublePositiveDecimal" }) + @PUT("number/big/double/99999999.99") + Observable> putBigDoublePositiveDecimal(@Body double numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getBigDoublePositiveDecimal" }) + @GET("number/big/double/99999999.99") + Observable> getBigDoublePositiveDecimal(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putBigDoubleNegativeDecimal" }) + @PUT("number/big/double/-99999999.99") + Observable> putBigDoubleNegativeDecimal(@Body double numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getBigDoubleNegativeDecimal" }) + @GET("number/big/double/-99999999.99") + Observable> getBigDoubleNegativeDecimal(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putBigDecimal" }) + @PUT("number/big/decimal/2.5976931e+101") + Observable> putBigDecimal(@Body BigDecimal numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getBigDecimal" }) + @GET("number/big/decimal/2.5976931e+101") + Observable> getBigDecimal(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putBigDecimalPositiveDecimal" }) + @PUT("number/big/decimal/99999999.99") + Observable> putBigDecimalPositiveDecimal(@Body BigDecimal numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getBigDecimalPositiveDecimal" }) + @GET("number/big/decimal/99999999.99") + Observable> getBigDecimalPositiveDecimal(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putBigDecimalNegativeDecimal" }) + @PUT("number/big/decimal/-99999999.99") + Observable> putBigDecimalNegativeDecimal(@Body BigDecimal numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getBigDecimalNegativeDecimal" }) + @GET("number/big/decimal/-99999999.99") + Observable> getBigDecimalNegativeDecimal(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putSmallFloat" }) + @PUT("number/small/float/3.402823e-20") + Observable> putSmallFloat(@Body double numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getSmallFloat" }) + @GET("number/small/float/3.402823e-20") + Observable> getSmallFloat(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putSmallDouble" }) + @PUT("number/small/double/2.5976931e-101") + Observable> putSmallDouble(@Body double numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getSmallDouble" }) + @GET("number/small/double/2.5976931e-101") + Observable> getSmallDouble(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers putSmallDecimal" }) + @PUT("number/small/decimal/2.5976931e-101") + Observable> putSmallDecimal(@Body BigDecimal numberBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodynumber.Numbers getSmallDecimal" }) + @GET("number/small/decimal/2.5976931e-101") + Observable> getSmallDecimal(); + + } + + /** + * Get null Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null Number value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid float Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getInvalidFloat() { + return getInvalidFloatWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid float Number value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidFloatAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidFloatWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid float Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getInvalidFloatAsync() { + return getInvalidFloatWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid float Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getInvalidFloatWithServiceResponseAsync() { + return service.getInvalidFloat() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidFloatDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid double Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getInvalidDouble() { + return getInvalidDoubleWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid double Number value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidDoubleAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidDoubleWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid double Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getInvalidDoubleAsync() { + return getInvalidDoubleWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid double Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getInvalidDoubleWithServiceResponseAsync() { + return service.getInvalidDouble() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDoubleDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get invalid decimal Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + public BigDecimal getInvalidDecimal() { + return getInvalidDecimalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get invalid decimal Number value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getInvalidDecimalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getInvalidDecimalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get invalid decimal Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable getInvalidDecimalAsync() { + return getInvalidDecimalWithServiceResponseAsync().map(new Func1, BigDecimal>() { + @Override + public BigDecimal call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get invalid decimal Number value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable> getInvalidDecimalWithServiceResponseAsync() { + return service.getInvalidDecimal() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getInvalidDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getInvalidDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put big float value 3.402823e+20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBigFloat(double numberBody) { + putBigFloatWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put big float value 3.402823e+20. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBigFloatAsync(double numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBigFloatWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put big float value 3.402823e+20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBigFloatAsync(double numberBody) { + return putBigFloatWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put big float value 3.402823e+20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBigFloatWithServiceResponseAsync(double numberBody) { + return service.putBigFloat(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBigFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBigFloatDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big float value 3.402823e+20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getBigFloat() { + return getBigFloatWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big float value 3.402823e+20. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBigFloatAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBigFloatWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big float value 3.402823e+20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getBigFloatAsync() { + return getBigFloatWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big float value 3.402823e+20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getBigFloatWithServiceResponseAsync() { + return service.getBigFloat() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBigFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBigFloatDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put big double value 2.5976931e+101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBigDouble(double numberBody) { + putBigDoubleWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put big double value 2.5976931e+101. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBigDoubleAsync(double numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBigDoubleWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put big double value 2.5976931e+101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBigDoubleAsync(double numberBody) { + return putBigDoubleWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put big double value 2.5976931e+101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBigDoubleWithServiceResponseAsync(double numberBody) { + return service.putBigDouble(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBigDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBigDoubleDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big double value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getBigDouble() { + return getBigDoubleWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big double value 2.5976931e+101. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBigDoubleAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBigDoubleWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big double value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getBigDoubleAsync() { + return getBigDoubleWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big double value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getBigDoubleWithServiceResponseAsync() { + return service.getBigDouble() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBigDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBigDoubleDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put big double value 99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBigDoublePositiveDecimal(double numberBody) { + putBigDoublePositiveDecimalWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put big double value 99999999.99. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBigDoublePositiveDecimalAsync(double numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBigDoublePositiveDecimalWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put big double value 99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBigDoublePositiveDecimalAsync(double numberBody) { + return putBigDoublePositiveDecimalWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put big double value 99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBigDoublePositiveDecimalWithServiceResponseAsync(double numberBody) { + return service.putBigDoublePositiveDecimal(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBigDoublePositiveDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBigDoublePositiveDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big double value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getBigDoublePositiveDecimal() { + return getBigDoublePositiveDecimalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big double value 99999999.99. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBigDoublePositiveDecimalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBigDoublePositiveDecimalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big double value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getBigDoublePositiveDecimalAsync() { + return getBigDoublePositiveDecimalWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big double value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getBigDoublePositiveDecimalWithServiceResponseAsync() { + return service.getBigDoublePositiveDecimal() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBigDoublePositiveDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBigDoublePositiveDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put big double value -99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBigDoubleNegativeDecimal(double numberBody) { + putBigDoubleNegativeDecimalWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put big double value -99999999.99. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBigDoubleNegativeDecimalAsync(double numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBigDoubleNegativeDecimalWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put big double value -99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBigDoubleNegativeDecimalAsync(double numberBody) { + return putBigDoubleNegativeDecimalWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put big double value -99999999.99. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBigDoubleNegativeDecimalWithServiceResponseAsync(double numberBody) { + return service.putBigDoubleNegativeDecimal(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBigDoubleNegativeDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBigDoubleNegativeDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big double value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getBigDoubleNegativeDecimal() { + return getBigDoubleNegativeDecimalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big double value -99999999.99. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBigDoubleNegativeDecimalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBigDoubleNegativeDecimalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big double value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getBigDoubleNegativeDecimalAsync() { + return getBigDoubleNegativeDecimalWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big double value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getBigDoubleNegativeDecimalWithServiceResponseAsync() { + return service.getBigDoubleNegativeDecimal() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBigDoubleNegativeDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBigDoubleNegativeDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put big decimal value 2.5976931e+101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBigDecimal(BigDecimal numberBody) { + putBigDecimalWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put big decimal value 2.5976931e+101. + * + * @param numberBody the BigDecimal value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBigDecimalAsync(BigDecimal numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBigDecimalWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put big decimal value 2.5976931e+101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBigDecimalAsync(BigDecimal numberBody) { + return putBigDecimalWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put big decimal value 2.5976931e+101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBigDecimalWithServiceResponseAsync(BigDecimal numberBody) { + if (numberBody == null) { + throw new IllegalArgumentException("Parameter numberBody is required and cannot be null."); + } + return service.putBigDecimal(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBigDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBigDecimalDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big decimal value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + public BigDecimal getBigDecimal() { + return getBigDecimalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big decimal value 2.5976931e+101. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBigDecimalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBigDecimalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big decimal value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable getBigDecimalAsync() { + return getBigDecimalWithServiceResponseAsync().map(new Func1, BigDecimal>() { + @Override + public BigDecimal call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big decimal value 2.5976931e+101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable> getBigDecimalWithServiceResponseAsync() { + return service.getBigDecimal() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBigDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBigDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put big decimal value 99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBigDecimalPositiveDecimal(BigDecimal numberBody) { + putBigDecimalPositiveDecimalWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put big decimal value 99999999.99. + * + * @param numberBody the BigDecimal value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBigDecimalPositiveDecimalAsync(BigDecimal numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBigDecimalPositiveDecimalWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put big decimal value 99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBigDecimalPositiveDecimalAsync(BigDecimal numberBody) { + return putBigDecimalPositiveDecimalWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put big decimal value 99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBigDecimalPositiveDecimalWithServiceResponseAsync(BigDecimal numberBody) { + if (numberBody == null) { + throw new IllegalArgumentException("Parameter numberBody is required and cannot be null."); + } + return service.putBigDecimalPositiveDecimal(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBigDecimalPositiveDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBigDecimalPositiveDecimalDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big decimal value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + public BigDecimal getBigDecimalPositiveDecimal() { + return getBigDecimalPositiveDecimalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big decimal value 99999999.99. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBigDecimalPositiveDecimalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBigDecimalPositiveDecimalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big decimal value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable getBigDecimalPositiveDecimalAsync() { + return getBigDecimalPositiveDecimalWithServiceResponseAsync().map(new Func1, BigDecimal>() { + @Override + public BigDecimal call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big decimal value 99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable> getBigDecimalPositiveDecimalWithServiceResponseAsync() { + return service.getBigDecimalPositiveDecimal() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBigDecimalPositiveDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBigDecimalPositiveDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put big decimal value -99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBigDecimalNegativeDecimal(BigDecimal numberBody) { + putBigDecimalNegativeDecimalWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put big decimal value -99999999.99. + * + * @param numberBody the BigDecimal value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBigDecimalNegativeDecimalAsync(BigDecimal numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBigDecimalNegativeDecimalWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put big decimal value -99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBigDecimalNegativeDecimalAsync(BigDecimal numberBody) { + return putBigDecimalNegativeDecimalWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put big decimal value -99999999.99. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBigDecimalNegativeDecimalWithServiceResponseAsync(BigDecimal numberBody) { + if (numberBody == null) { + throw new IllegalArgumentException("Parameter numberBody is required and cannot be null."); + } + return service.putBigDecimalNegativeDecimal(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBigDecimalNegativeDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBigDecimalNegativeDecimalDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big decimal value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + public BigDecimal getBigDecimalNegativeDecimal() { + return getBigDecimalNegativeDecimalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big decimal value -99999999.99. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBigDecimalNegativeDecimalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBigDecimalNegativeDecimalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big decimal value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable getBigDecimalNegativeDecimalAsync() { + return getBigDecimalNegativeDecimalWithServiceResponseAsync().map(new Func1, BigDecimal>() { + @Override + public BigDecimal call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big decimal value -99999999.99. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable> getBigDecimalNegativeDecimalWithServiceResponseAsync() { + return service.getBigDecimalNegativeDecimal() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBigDecimalNegativeDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBigDecimalNegativeDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put small float value 3.402823e-20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putSmallFloat(double numberBody) { + putSmallFloatWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put small float value 3.402823e-20. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSmallFloatAsync(double numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSmallFloatWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put small float value 3.402823e-20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putSmallFloatAsync(double numberBody) { + return putSmallFloatWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put small float value 3.402823e-20. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putSmallFloatWithServiceResponseAsync(double numberBody) { + return service.putSmallFloat(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putSmallFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putSmallFloatDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big double value 3.402823e-20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getSmallFloat() { + return getSmallFloatWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big double value 3.402823e-20. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSmallFloatAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSmallFloatWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big double value 3.402823e-20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getSmallFloatAsync() { + return getSmallFloatWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big double value 3.402823e-20. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getSmallFloatWithServiceResponseAsync() { + return service.getSmallFloat() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSmallFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSmallFloatDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put small double value 2.5976931e-101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putSmallDouble(double numberBody) { + putSmallDoubleWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put small double value 2.5976931e-101. + * + * @param numberBody the double value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSmallDoubleAsync(double numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSmallDoubleWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put small double value 2.5976931e-101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putSmallDoubleAsync(double numberBody) { + return putSmallDoubleWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put small double value 2.5976931e-101. + * + * @param numberBody the double value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putSmallDoubleWithServiceResponseAsync(double numberBody) { + return service.putSmallDouble(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putSmallDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putSmallDoubleDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get big double value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the double object if successful. + */ + public double getSmallDouble() { + return getSmallDoubleWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get big double value 2.5976931e-101. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSmallDoubleAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSmallDoubleWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get big double value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable getSmallDoubleAsync() { + return getSmallDoubleWithServiceResponseAsync().map(new Func1, Double>() { + @Override + public Double call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get big double value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Double object + */ + public Observable> getSmallDoubleWithServiceResponseAsync() { + return service.getSmallDouble() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSmallDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSmallDoubleDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put small decimal value 2.5976931e-101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putSmallDecimal(BigDecimal numberBody) { + putSmallDecimalWithServiceResponseAsync(numberBody).toBlocking().single().body(); + } + + /** + * Put small decimal value 2.5976931e-101. + * + * @param numberBody the BigDecimal value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSmallDecimalAsync(BigDecimal numberBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSmallDecimalWithServiceResponseAsync(numberBody), serviceCallback); + } + + /** + * Put small decimal value 2.5976931e-101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putSmallDecimalAsync(BigDecimal numberBody) { + return putSmallDecimalWithServiceResponseAsync(numberBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put small decimal value 2.5976931e-101. + * + * @param numberBody the BigDecimal value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putSmallDecimalWithServiceResponseAsync(BigDecimal numberBody) { + if (numberBody == null) { + throw new IllegalArgumentException("Parameter numberBody is required and cannot be null."); + } + return service.putSmallDecimal(numberBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putSmallDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putSmallDecimalDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get small decimal value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BigDecimal object if successful. + */ + public BigDecimal getSmallDecimal() { + return getSmallDecimalWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get small decimal value 2.5976931e-101. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getSmallDecimalAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSmallDecimalWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get small decimal value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable getSmallDecimalAsync() { + return getSmallDecimalWithServiceResponseAsync().map(new Func1, BigDecimal>() { + @Override + public BigDecimal call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get small decimal value 2.5976931e-101. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BigDecimal object + */ + public Observable> getSmallDecimalWithServiceResponseAsync() { + return service.getSmallDecimal() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSmallDecimalDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSmallDecimalDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodynumber/implementation/package-info.java new file mode 100644 index 0000000000..de3dfc4f90 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestNumberTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodynumber.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/models/Error.java b/test/vanilla/src/main/java/fixtures/bodynumber/models/Error.java new file mode 100644 index 0000000000..9e4b24afa9 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodynumber.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodynumber/models/ErrorException.java new file mode 100644 index 0000000000..67363e675b --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodynumber.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodynumber/models/package-info.java new file mode 100644 index 0000000000..ca2d802862 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestNumberTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodynumber.models; diff --git a/test/vanilla/src/main/java/fixtures/bodynumber/package-info.java b/test/vanilla/src/main/java/fixtures/bodynumber/package-info.java new file mode 100644 index 0000000000..fedc738174 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodynumber/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestNumberTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.bodynumber; diff --git a/test/vanilla/src/main/java/fixtures/bodystring/AutoRestSwaggerBATService.java b/test/vanilla/src/main/java/fixtures/bodystring/AutoRestSwaggerBATService.java new file mode 100644 index 0000000000..2854dde9c0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/AutoRestSwaggerBATService.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestSwaggerBATService class. + */ +public interface AutoRestSwaggerBATService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Strings object to access its operations. + * @return the Strings object. + */ + Strings strings(); + + /** + * Gets the Enums object to access its operations. + * @return the Enums object. + */ + Enums enums(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/Enums.java b/test/vanilla/src/main/java/fixtures/bodystring/Enums.java new file mode 100644 index 0000000000..785135ef7d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/Enums.java @@ -0,0 +1,246 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodystring.models.Colors; +import fixtures.bodystring.models.ErrorException; +import fixtures.bodystring.models.RefColorConstant; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Enums. + */ +public interface Enums { + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Colors object if successful. + */ + Colors getNotExpandable(); + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNotExpandableAsync(final ServiceCallback serviceCallback); + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Colors object + */ + Observable getNotExpandableAsync(); + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Colors object + */ + Observable> getNotExpandableWithServiceResponseAsync(); + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param stringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putNotExpandable(Colors stringBody); + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param stringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNotExpandableAsync(Colors stringBody, final ServiceCallback serviceCallback); + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param stringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putNotExpandableAsync(Colors stringBody); + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param stringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putNotExpandableWithServiceResponseAsync(Colors stringBody); + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Colors object if successful. + */ + Colors getReferenced(); + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getReferencedAsync(final ServiceCallback serviceCallback); + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Colors object + */ + Observable getReferencedAsync(); + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Colors object + */ + Observable> getReferencedWithServiceResponseAsync(); + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param enumStringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putReferenced(Colors enumStringBody); + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param enumStringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putReferencedAsync(Colors enumStringBody, final ServiceCallback serviceCallback); + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param enumStringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putReferencedAsync(Colors enumStringBody); + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param enumStringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putReferencedWithServiceResponseAsync(Colors enumStringBody); + + /** + * Get value 'green-color' from the constant. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RefColorConstant object if successful. + */ + RefColorConstant getReferencedConstant(); + + /** + * Get value 'green-color' from the constant. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getReferencedConstantAsync(final ServiceCallback serviceCallback); + + /** + * Get value 'green-color' from the constant. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RefColorConstant object + */ + Observable getReferencedConstantAsync(); + + /** + * Get value 'green-color' from the constant. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RefColorConstant object + */ + Observable> getReferencedConstantWithServiceResponseAsync(); + + /** + * Sends value 'green-color' from a constant. + * + * @param enumStringBody the RefColorConstant value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putReferencedConstant(RefColorConstant enumStringBody); + + /** + * Sends value 'green-color' from a constant. + * + * @param enumStringBody the RefColorConstant value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putReferencedConstantAsync(RefColorConstant enumStringBody, final ServiceCallback serviceCallback); + + /** + * Sends value 'green-color' from a constant. + * + * @param enumStringBody the RefColorConstant value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putReferencedConstantAsync(RefColorConstant enumStringBody); + + /** + * Sends value 'green-color' from a constant. + * + * @param enumStringBody the RefColorConstant value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putReferencedConstantWithServiceResponseAsync(RefColorConstant enumStringBody); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/Strings.java b/test/vanilla/src/main/java/fixtures/bodystring/Strings.java new file mode 100644 index 0000000000..742602a2d6 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/Strings.java @@ -0,0 +1,528 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodystring.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Strings. + */ +public interface Strings { + /** + * Get null string value value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + String getNull(); + + /** + * Get null string value value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null string value value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable getNullAsync(); + + /** + * Get null string value value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable> getNullWithServiceResponseAsync(); + + /** + * Set string value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putNull(); + + /** + * Set string value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNullAsync(final ServiceCallback serviceCallback); + + /** + * Set string value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putNullAsync(); + + /** + * Set string value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putNullWithServiceResponseAsync(); + /** + * Set string value null. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putNull(String stringBody); + + /** + * Set string value null. + * + * @param stringBody Possible values include: '' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putNullAsync(String stringBody, final ServiceCallback serviceCallback); + + /** + * Set string value null. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putNullAsync(String stringBody); + + /** + * Set string value null. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putNullWithServiceResponseAsync(String stringBody); + + /** + * Get empty string value value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + String getEmpty(); + + /** + * Get empty string value value ''. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get empty string value value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable getEmptyAsync(); + + /** + * Get empty string value value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable> getEmptyWithServiceResponseAsync(); + + /** + * Set string value empty ''. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putEmpty(String stringBody); + + /** + * Set string value empty ''. + * + * @param stringBody Possible values include: '' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putEmptyAsync(String stringBody, final ServiceCallback serviceCallback); + + /** + * Set string value empty ''. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putEmptyAsync(String stringBody); + + /** + * Set string value empty ''. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putEmptyWithServiceResponseAsync(String stringBody); + + /** + * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + String getMbcs(); + + /** + * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getMbcsAsync(final ServiceCallback serviceCallback); + + /** + * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable getMbcsAsync(); + + /** + * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable> getMbcsWithServiceResponseAsync(); + + /** + * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param stringBody Possible values include: '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putMbcs(String stringBody); + + /** + * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param stringBody Possible values include: '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ ' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putMbcsAsync(String stringBody, final ServiceCallback serviceCallback); + + /** + * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param stringBody Possible values include: '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putMbcsAsync(String stringBody); + + /** + * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param stringBody Possible values include: '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putMbcsWithServiceResponseAsync(String stringBody); + + /** + * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + String getWhitespace(); + + /** + * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getWhitespaceAsync(final ServiceCallback serviceCallback); + + /** + * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable getWhitespaceAsync(); + + /** + * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable> getWhitespaceWithServiceResponseAsync(); + + /** + * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param stringBody Possible values include: ' Now is the time for all good men to come to the aid of their country ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putWhitespace(String stringBody); + + /** + * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param stringBody Possible values include: ' Now is the time for all good men to come to the aid of their country ' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putWhitespaceAsync(String stringBody, final ServiceCallback serviceCallback); + + /** + * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param stringBody Possible values include: ' Now is the time for all good men to come to the aid of their country ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putWhitespaceAsync(String stringBody); + + /** + * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param stringBody Possible values include: ' Now is the time for all good men to come to the aid of their country ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putWhitespaceWithServiceResponseAsync(String stringBody); + + /** + * Get String value when no string value is sent in response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + String getNotProvided(); + + /** + * Get String value when no string value is sent in response payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNotProvidedAsync(final ServiceCallback serviceCallback); + + /** + * Get String value when no string value is sent in response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable getNotProvidedAsync(); + + /** + * Get String value when no string value is sent in response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + Observable> getNotProvidedWithServiceResponseAsync(); + + /** + * Get value that is base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + byte[] getBase64Encoded(); + + /** + * Get value that is base64 encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBase64EncodedAsync(final ServiceCallback serviceCallback); + + /** + * Get value that is base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable getBase64EncodedAsync(); + + /** + * Get value that is base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable> getBase64EncodedWithServiceResponseAsync(); + + /** + * Get value that is base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + byte[] getBase64UrlEncoded(); + + /** + * Get value that is base64url encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBase64UrlEncodedAsync(final ServiceCallback serviceCallback); + + /** + * Get value that is base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable getBase64UrlEncodedAsync(); + + /** + * Get value that is base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable> getBase64UrlEncodedWithServiceResponseAsync(); + + /** + * Put value that is base64url encoded. + * + * @param stringBody the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putBase64UrlEncoded(byte[] stringBody); + + /** + * Put value that is base64url encoded. + * + * @param stringBody the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putBase64UrlEncodedAsync(byte[] stringBody, final ServiceCallback serviceCallback); + + /** + * Put value that is base64url encoded. + * + * @param stringBody the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putBase64UrlEncodedAsync(byte[] stringBody); + + /** + * Put value that is base64url encoded. + * + * @param stringBody the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putBase64UrlEncodedWithServiceResponseAsync(byte[] stringBody); + + /** + * Get null value that is expected to be base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + byte[] getNullBase64UrlEncoded(); + + /** + * Get null value that is expected to be base64url encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNullBase64UrlEncodedAsync(final ServiceCallback serviceCallback); + + /** + * Get null value that is expected to be base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable getNullBase64UrlEncodedAsync(); + + /** + * Get null value that is expected to be base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + Observable> getNullBase64UrlEncodedWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/implementation/AutoRestSwaggerBATServiceImpl.java b/test/vanilla/src/main/java/fixtures/bodystring/implementation/AutoRestSwaggerBATServiceImpl.java new file mode 100644 index 0000000000..e20cbf2f39 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/implementation/AutoRestSwaggerBATServiceImpl.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring.implementation; + +import fixtures.bodystring.AutoRestSwaggerBATService; +import fixtures.bodystring.Strings; +import fixtures.bodystring.Enums; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestSwaggerBATService class. + */ +public class AutoRestSwaggerBATServiceImpl extends ServiceClient implements AutoRestSwaggerBATService { + + /** + * The Strings object to access its operations. + */ + private Strings strings; + + /** + * Gets the Strings object to access its operations. + * @return the Strings object. + */ + public Strings strings() { + return this.strings; + } + + /** + * The Enums object to access its operations. + */ + private Enums enums; + + /** + * Gets the Enums object to access its operations. + * @return the Enums object. + */ + public Enums enums() { + return this.enums; + } + + /** + * Initializes an instance of AutoRestSwaggerBATService client. + */ + public AutoRestSwaggerBATServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestSwaggerBATService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestSwaggerBATServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestSwaggerBATServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.strings = new StringsImpl(retrofit(), this); + this.enums = new EnumsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java b/test/vanilla/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java new file mode 100644 index 0000000000..ee2cec9a64 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/implementation/EnumsImpl.java @@ -0,0 +1,500 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring.implementation; + +import retrofit2.Retrofit; +import fixtures.bodystring.Enums; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.bodystring.models.Colors; +import fixtures.bodystring.models.ErrorException; +import fixtures.bodystring.models.RefColorConstant; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Enums. + */ +public class EnumsImpl implements Enums { + /** The Retrofit service to perform REST calls. */ + private EnumsService service; + /** The service client containing this operation class. */ + private AutoRestSwaggerBATServiceImpl client; + + /** + * Initializes an instance of Enums. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public EnumsImpl(Retrofit retrofit, AutoRestSwaggerBATServiceImpl client) { + this.service = retrofit.create(EnumsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Enums to be + * used by Retrofit to perform actually REST calls. + */ + interface EnumsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Enums getNotExpandable" }) + @GET("string/enum/notExpandable") + Observable> getNotExpandable(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Enums putNotExpandable" }) + @PUT("string/enum/notExpandable") + Observable> putNotExpandable(@Body Colors stringBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Enums getReferenced" }) + @GET("string/enum/Referenced") + Observable> getReferenced(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Enums putReferenced" }) + @PUT("string/enum/Referenced") + Observable> putReferenced(@Body Colors enumStringBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Enums getReferencedConstant" }) + @GET("string/enum/ReferencedConstant") + Observable> getReferencedConstant(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Enums putReferencedConstant" }) + @PUT("string/enum/ReferencedConstant") + Observable> putReferencedConstant(@Body RefColorConstant enumStringBody); + + } + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Colors object if successful. + */ + public Colors getNotExpandable() { + return getNotExpandableWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNotExpandableAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNotExpandableWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Colors object + */ + public Observable getNotExpandableAsync() { + return getNotExpandableWithServiceResponseAsync().map(new Func1, Colors>() { + @Override + public Colors call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Colors object + */ + public Observable> getNotExpandableWithServiceResponseAsync() { + return service.getNotExpandable() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNotExpandableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNotExpandableDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param stringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putNotExpandable(Colors stringBody) { + putNotExpandableWithServiceResponseAsync(stringBody).toBlocking().single().body(); + } + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param stringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNotExpandableAsync(Colors stringBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNotExpandableWithServiceResponseAsync(stringBody), serviceCallback); + } + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param stringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putNotExpandableAsync(Colors stringBody) { + return putNotExpandableWithServiceResponseAsync(stringBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param stringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putNotExpandableWithServiceResponseAsync(Colors stringBody) { + if (stringBody == null) { + throw new IllegalArgumentException("Parameter stringBody is required and cannot be null."); + } + return service.putNotExpandable(stringBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putNotExpandableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putNotExpandableDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Colors object if successful. + */ + public Colors getReferenced() { + return getReferencedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReferencedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReferencedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Colors object + */ + public Observable getReferencedAsync() { + return getReferencedWithServiceResponseAsync().map(new Func1, Colors>() { + @Override + public Colors call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get enum value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Colors object + */ + public Observable> getReferencedWithServiceResponseAsync() { + return service.getReferenced() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReferencedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReferencedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param enumStringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putReferenced(Colors enumStringBody) { + putReferencedWithServiceResponseAsync(enumStringBody).toBlocking().single().body(); + } + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param enumStringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putReferencedAsync(Colors enumStringBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putReferencedWithServiceResponseAsync(enumStringBody), serviceCallback); + } + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param enumStringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putReferencedAsync(Colors enumStringBody) { + return putReferencedWithServiceResponseAsync(enumStringBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends value 'red color' from enumeration of 'red color', 'green-color', 'blue_color'. + * + * @param enumStringBody Possible values include: 'red color', 'green-color', 'blue_color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putReferencedWithServiceResponseAsync(Colors enumStringBody) { + if (enumStringBody == null) { + throw new IllegalArgumentException("Parameter enumStringBody is required and cannot be null."); + } + return service.putReferenced(enumStringBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putReferencedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putReferencedDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get value 'green-color' from the constant. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RefColorConstant object if successful. + */ + public RefColorConstant getReferencedConstant() { + return getReferencedConstantWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get value 'green-color' from the constant. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getReferencedConstantAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getReferencedConstantWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get value 'green-color' from the constant. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RefColorConstant object + */ + public Observable getReferencedConstantAsync() { + return getReferencedConstantWithServiceResponseAsync().map(new Func1, RefColorConstant>() { + @Override + public RefColorConstant call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get value 'green-color' from the constant. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RefColorConstant object + */ + public Observable> getReferencedConstantWithServiceResponseAsync() { + return service.getReferencedConstant() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getReferencedConstantDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getReferencedConstantDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Sends value 'green-color' from a constant. + * + * @param enumStringBody the RefColorConstant value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putReferencedConstant(RefColorConstant enumStringBody) { + putReferencedConstantWithServiceResponseAsync(enumStringBody).toBlocking().single().body(); + } + + /** + * Sends value 'green-color' from a constant. + * + * @param enumStringBody the RefColorConstant value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putReferencedConstantAsync(RefColorConstant enumStringBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putReferencedConstantWithServiceResponseAsync(enumStringBody), serviceCallback); + } + + /** + * Sends value 'green-color' from a constant. + * + * @param enumStringBody the RefColorConstant value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putReferencedConstantAsync(RefColorConstant enumStringBody) { + return putReferencedConstantWithServiceResponseAsync(enumStringBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sends value 'green-color' from a constant. + * + * @param enumStringBody the RefColorConstant value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putReferencedConstantWithServiceResponseAsync(RefColorConstant enumStringBody) { + if (enumStringBody == null) { + throw new IllegalArgumentException("Parameter enumStringBody is required and cannot be null."); + } + Validator.validate(enumStringBody); + return service.putReferencedConstant(enumStringBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putReferencedConstantDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putReferencedConstantDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/implementation/StringsImpl.java b/test/vanilla/src/main/java/fixtures/bodystring/implementation/StringsImpl.java new file mode 100644 index 0000000000..9ec695802d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/implementation/StringsImpl.java @@ -0,0 +1,1071 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring.implementation; + +import retrofit2.Retrofit; +import fixtures.bodystring.Strings; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.Base64Url; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.bodystring.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Strings. + */ +public class StringsImpl implements Strings { + /** The Retrofit service to perform REST calls. */ + private StringsService service; + /** The service client containing this operation class. */ + private AutoRestSwaggerBATServiceImpl client; + + /** + * Initializes an instance of Strings. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StringsImpl(Retrofit retrofit, AutoRestSwaggerBATServiceImpl client) { + this.service = retrofit.create(StringsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Strings to be + * used by Retrofit to perform actually REST calls. + */ + interface StringsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings getNull" }) + @GET("string/null") + Observable> getNull(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings putNull" }) + @PUT("string/null") + Observable> putNull(@Body String stringBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings getEmpty" }) + @GET("string/empty") + Observable> getEmpty(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings putEmpty" }) + @PUT("string/empty") + Observable> putEmpty(@Body String stringBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings getMbcs" }) + @GET("string/mbcs") + Observable> getMbcs(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings putMbcs" }) + @PUT("string/mbcs") + Observable> putMbcs(@Body String stringBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings getWhitespace" }) + @GET("string/whitespace") + Observable> getWhitespace(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings putWhitespace" }) + @PUT("string/whitespace") + Observable> putWhitespace(@Body String stringBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings getNotProvided" }) + @GET("string/notProvided") + Observable> getNotProvided(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings getBase64Encoded" }) + @GET("string/base64Encoding") + Observable> getBase64Encoded(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings getBase64UrlEncoded" }) + @GET("string/base64UrlEncoding") + Observable> getBase64UrlEncoded(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings putBase64UrlEncoded" }) + @PUT("string/base64UrlEncoding") + Observable> putBase64UrlEncoded(@Body Base64Url stringBody); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodystring.Strings getNullBase64UrlEncoded" }) + @GET("string/nullBase64UrlEncoding") + Observable> getNullBase64UrlEncoded(); + + } + + /** + * Get null string value value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getNull() { + return getNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null string value value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null string value value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable getNullAsync() { + return getNullWithServiceResponseAsync().map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null string value value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> getNullWithServiceResponseAsync() { + return service.getNull() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set string value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putNull() { + putNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Set string value null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Set string value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putNullAsync() { + return putNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set string value null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putNullWithServiceResponseAsync() { + final String stringBody = null; + return service.putNull(stringBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Set string value null. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putNull(String stringBody) { + putNullWithServiceResponseAsync(stringBody).toBlocking().single().body(); + } + + /** + * Set string value null. + * + * @param stringBody Possible values include: '' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putNullAsync(String stringBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putNullWithServiceResponseAsync(stringBody), serviceCallback); + } + + /** + * Set string value null. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putNullAsync(String stringBody) { + return putNullWithServiceResponseAsync(stringBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set string value null. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putNullWithServiceResponseAsync(String stringBody) { + return service.putNull(stringBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get empty string value value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getEmpty() { + return getEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty string value value ''. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty string value value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable getEmptyAsync() { + return getEmptyWithServiceResponseAsync().map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get empty string value value ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> getEmptyWithServiceResponseAsync() { + return service.getEmpty() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set string value empty ''. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putEmpty(String stringBody) { + putEmptyWithServiceResponseAsync(stringBody).toBlocking().single().body(); + } + + /** + * Set string value empty ''. + * + * @param stringBody Possible values include: '' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putEmptyAsync(String stringBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putEmptyWithServiceResponseAsync(stringBody), serviceCallback); + } + + /** + * Set string value empty ''. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putEmptyAsync(String stringBody) { + return putEmptyWithServiceResponseAsync(stringBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set string value empty ''. + * + * @param stringBody Possible values include: '' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putEmptyWithServiceResponseAsync(String stringBody) { + if (stringBody == null) { + throw new IllegalArgumentException("Parameter stringBody is required and cannot be null."); + } + return service.putEmpty(stringBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getMbcs() { + return getMbcsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getMbcsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getMbcsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable getMbcsAsync() { + return getMbcsWithServiceResponseAsync().map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get mbcs string value '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> getMbcsWithServiceResponseAsync() { + return service.getMbcs() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getMbcsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getMbcsDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param stringBody Possible values include: '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putMbcs(String stringBody) { + putMbcsWithServiceResponseAsync(stringBody).toBlocking().single().body(); + } + + /** + * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param stringBody Possible values include: '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ ' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putMbcsAsync(String stringBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putMbcsWithServiceResponseAsync(stringBody), serviceCallback); + } + + /** + * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param stringBody Possible values include: '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putMbcsAsync(String stringBody) { + return putMbcsWithServiceResponseAsync(stringBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set string value mbcs '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ '. + * + * @param stringBody Possible values include: '啊齄丂狛狜隣郎隣兀﨩ˊ▇█〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑɡ〇〾⿻⺁䜣€ ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putMbcsWithServiceResponseAsync(String stringBody) { + if (stringBody == null) { + throw new IllegalArgumentException("Parameter stringBody is required and cannot be null."); + } + return service.putMbcs(stringBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putMbcsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putMbcsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getWhitespace() { + return getWhitespaceWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getWhitespaceAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWhitespaceWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable getWhitespaceAsync() { + return getWhitespaceWithServiceResponseAsync().map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get string value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> getWhitespaceWithServiceResponseAsync() { + return service.getWhitespace() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getWhitespaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getWhitespaceDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param stringBody Possible values include: ' Now is the time for all good men to come to the aid of their country ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putWhitespace(String stringBody) { + putWhitespaceWithServiceResponseAsync(stringBody).toBlocking().single().body(); + } + + /** + * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param stringBody Possible values include: ' Now is the time for all good men to come to the aid of their country ' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putWhitespaceAsync(String stringBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWhitespaceWithServiceResponseAsync(stringBody), serviceCallback); + } + + /** + * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param stringBody Possible values include: ' Now is the time for all good men to come to the aid of their country ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putWhitespaceAsync(String stringBody) { + return putWhitespaceWithServiceResponseAsync(stringBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Set String value with leading and trailing whitespace '<tab><space><space>Now is the time for all good men to come to the aid of their country<tab><space><space>'. + * + * @param stringBody Possible values include: ' Now is the time for all good men to come to the aid of their country ' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putWhitespaceWithServiceResponseAsync(String stringBody) { + if (stringBody == null) { + throw new IllegalArgumentException("Parameter stringBody is required and cannot be null."); + } + return service.putWhitespace(stringBody) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putWhitespaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putWhitespaceDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get String value when no string value is sent in response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the String object if successful. + */ + public String getNotProvided() { + return getNotProvidedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get String value when no string value is sent in response payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNotProvidedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNotProvidedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get String value when no string value is sent in response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable getNotProvidedAsync() { + return getNotProvidedWithServiceResponseAsync().map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get String value when no string value is sent in response payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the String object + */ + public Observable> getNotProvidedWithServiceResponseAsync() { + return service.getNotProvided() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNotProvidedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNotProvidedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get value that is base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + public byte[] getBase64Encoded() { + return getBase64EncodedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get value that is base64 encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBase64EncodedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBase64EncodedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get value that is base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable getBase64EncodedAsync() { + return getBase64EncodedWithServiceResponseAsync().map(new Func1, byte[]>() { + @Override + public byte[] call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get value that is base64 encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable> getBase64EncodedWithServiceResponseAsync() { + return service.getBase64Encoded() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getBase64EncodedDelegate(response); + byte[] body = null; + if (result.body() != null) { + body = result.body().decodedBytes(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBase64EncodedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get value that is base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + public byte[] getBase64UrlEncoded() { + return getBase64UrlEncodedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get value that is base64url encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBase64UrlEncodedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBase64UrlEncodedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get value that is base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable getBase64UrlEncodedAsync() { + return getBase64UrlEncodedWithServiceResponseAsync().map(new Func1, byte[]>() { + @Override + public byte[] call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get value that is base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable> getBase64UrlEncodedWithServiceResponseAsync() { + return service.getBase64UrlEncoded() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getBase64UrlEncodedDelegate(response); + byte[] body = null; + if (result.body() != null) { + body = result.body().decodedBytes(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBase64UrlEncodedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put value that is base64url encoded. + * + * @param stringBody the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putBase64UrlEncoded(byte[] stringBody) { + putBase64UrlEncodedWithServiceResponseAsync(stringBody).toBlocking().single().body(); + } + + /** + * Put value that is base64url encoded. + * + * @param stringBody the Base64Url value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putBase64UrlEncodedAsync(byte[] stringBody, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putBase64UrlEncodedWithServiceResponseAsync(stringBody), serviceCallback); + } + + /** + * Put value that is base64url encoded. + * + * @param stringBody the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putBase64UrlEncodedAsync(byte[] stringBody) { + return putBase64UrlEncodedWithServiceResponseAsync(stringBody).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put value that is base64url encoded. + * + * @param stringBody the Base64Url value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putBase64UrlEncodedWithServiceResponseAsync(byte[] stringBody) { + if (stringBody == null) { + throw new IllegalArgumentException("Parameter stringBody is required and cannot be null."); + } + Base64Url stringBodyConverted = Base64Url.encode(stringBody); + return service.putBase64UrlEncoded(stringBodyConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putBase64UrlEncodedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putBase64UrlEncodedDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null value that is expected to be base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the byte[] object if successful. + */ + public byte[] getNullBase64UrlEncoded() { + return getNullBase64UrlEncodedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null value that is expected to be base64url encoded. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNullBase64UrlEncodedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNullBase64UrlEncodedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null value that is expected to be base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable getNullBase64UrlEncodedAsync() { + return getNullBase64UrlEncodedWithServiceResponseAsync().map(new Func1, byte[]>() { + @Override + public byte[] call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null value that is expected to be base64url encoded. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the byte[] object + */ + public Observable> getNullBase64UrlEncodedWithServiceResponseAsync() { + return service.getNullBase64UrlEncoded() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse result = getNullBase64UrlEncodedDelegate(response); + byte[] body = null; + if (result.body() != null) { + body = result.body().decodedBytes(); + } + ServiceResponse clientResponse = new ServiceResponse(body, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNullBase64UrlEncodedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/bodystring/implementation/package-info.java new file mode 100644 index 0000000000..5d25ec788e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestSwaggerBATService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodystring.implementation; diff --git a/test/vanilla/src/main/java/fixtures/bodystring/models/Colors.java b/test/vanilla/src/main/java/fixtures/bodystring/models/Colors.java new file mode 100644 index 0000000000..c7530f5432 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/models/Colors.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for Colors. + */ +public enum Colors { + /** Enum value red color. */ + RED_COLOR("red color"), + + /** Enum value green-color. */ + GREEN_COLOR("green-color"), + + /** Enum value blue_color. */ + BLUE_COLOR("blue_color"); + + /** The actual serialized value for a Colors instance. */ + private String value; + + Colors(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a Colors instance. + * + * @param value the serialized value to parse. + * @return the parsed Colors object, or null if unable to parse. + */ + @JsonCreator + public static Colors fromString(String value) { + Colors[] items = Colors.values(); + for (Colors item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/models/Error.java b/test/vanilla/src/main/java/fixtures/bodystring/models/Error.java new file mode 100644 index 0000000000..ccc40ec38c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/bodystring/models/ErrorException.java new file mode 100644 index 0000000000..a40e9fb8f8 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/models/RefColorConstant.java b/test/vanilla/src/main/java/fixtures/bodystring/models/RefColorConstant.java new file mode 100644 index 0000000000..39d4eac711 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/models/RefColorConstant.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.bodystring.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The RefColorConstant model. + */ +public class RefColorConstant { + /** + * Referenced Color Constant Description. + */ + @JsonProperty(value = "ColorConstant", required = true) + private String colorConstant; + + /** + * Sample string. + */ + @JsonProperty(value = "field1") + private String field1; + + /** + * Creates an instance of RefColorConstant class. + */ + public RefColorConstant() { + colorConstant = "green-color"; + } + + /** + * Get the colorConstant value. + * + * @return the colorConstant value + */ + public String colorConstant() { + return this.colorConstant; + } + + /** + * Set the colorConstant value. + * + * @param colorConstant the colorConstant value to set + * @return the RefColorConstant object itself. + */ + public RefColorConstant withColorConstant(String colorConstant) { + this.colorConstant = colorConstant; + return this; + } + + /** + * Get the field1 value. + * + * @return the field1 value + */ + public String field1() { + return this.field1; + } + + /** + * Set the field1 value. + * + * @param field1 the field1 value to set + * @return the RefColorConstant object itself. + */ + public RefColorConstant withField1(String field1) { + this.field1 = field1; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/bodystring/models/package-info.java b/test/vanilla/src/main/java/fixtures/bodystring/models/package-info.java new file mode 100644 index 0000000000..7f572801a5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestSwaggerBATService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodystring.models; diff --git a/test/vanilla/src/main/java/fixtures/bodystring/package-info.java b/test/vanilla/src/main/java/fixtures/bodystring/package-info.java new file mode 100644 index 0000000000..7cb0dd8c5d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/bodystring/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestSwaggerBATService. + * Test Infrastructure for AutoRest Swagger BAT. + */ +package fixtures.bodystring; diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/AutoRestParameterizedHostTestClient.java b/test/vanilla/src/main/java/fixtures/custombaseuri/AutoRestParameterizedHostTestClient.java new file mode 100644 index 0000000000..d9d3b71cae --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/AutoRestParameterizedHostTestClient.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestParameterizedHostTestClient class. + */ +public interface AutoRestParameterizedHostTestClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://{accountName}{host}"; + + /** + * Gets A string value that is used as a global part of the parameterized host. + * + * @return the host value. + */ + String host(); + + /** + * Sets A string value that is used as a global part of the parameterized host. + * + * @param host the host value. + * @return the service client itself + */ + AutoRestParameterizedHostTestClient withHost(String host); + + /** + * Gets the Paths object to access its operations. + * @return the Paths object. + */ + Paths paths(); + +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/Paths.java b/test/vanilla/src/main/java/fixtures/custombaseuri/Paths.java new file mode 100644 index 0000000000..9ee241bf70 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/Paths.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.custombaseuri.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public interface Paths { + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getEmpty(String accountName); + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(String accountName, final ServiceCallback serviceCallback); + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getEmptyAsync(String accountName); + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getEmptyWithServiceResponseAsync(String accountName); + +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java b/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java new file mode 100644 index 0000000000..5232a98a07 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/AutoRestParameterizedHostTestClientImpl.java @@ -0,0 +1,115 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.implementation; + +import fixtures.custombaseuri.AutoRestParameterizedHostTestClient; +import fixtures.custombaseuri.Paths; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestParameterizedHostTestClient class. + */ +public class AutoRestParameterizedHostTestClientImpl extends ServiceClient implements AutoRestParameterizedHostTestClient { + + /** A string value that is used as a global part of the parameterized host. */ + private String host; + + /** + * Gets A string value that is used as a global part of the parameterized host. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Sets A string value that is used as a global part of the parameterized host. + * + * @param host the host value. + * @return the service client itself + */ + public AutoRestParameterizedHostTestClientImpl withHost(String host) { + this.host = host; + return this; + } + + /** + * The Paths object to access its operations. + */ + private Paths paths; + + /** + * Gets the Paths object to access its operations. + * @return the Paths object. + */ + public Paths paths() { + return this.paths; + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + */ + public AutoRestParameterizedHostTestClientImpl() { + this("http://{accountName}{host}"); + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param baseUrl the base URL of the host + */ + private AutoRestParameterizedHostTestClientImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestParameterizedHostTestClientImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://{accountName}{host}", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + private AutoRestParameterizedHostTestClientImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedHostTestClient client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestParameterizedHostTestClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.host = "host"; + this.paths = new PathsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/PathsImpl.java b/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/PathsImpl.java new file mode 100644 index 0000000000..8b2829eb72 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/PathsImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.implementation; + +import retrofit2.Retrofit; +import fixtures.custombaseuri.Paths; +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.custombaseuri.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public class PathsImpl implements Paths { + /** The Retrofit service to perform REST calls. */ + private PathsService service; + /** The service client containing this operation class. */ + private AutoRestParameterizedHostTestClientImpl client; + + /** + * Initializes an instance of Paths. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PathsImpl(Retrofit retrofit, AutoRestParameterizedHostTestClientImpl client) { + this.service = retrofit.create(PathsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Paths to be + * used by Retrofit to perform actually REST calls. + */ + interface PathsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.custombaseuri.Paths getEmpty" }) + @GET("customuri") + Observable> getEmpty(@Header("x-ms-parameterized-host") String parameterizedHost); + + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getEmpty(String accountName) { + getEmptyWithServiceResponseAsync(accountName).toBlocking().single().body(); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(accountName), serviceCallback); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getEmptyAsync(String accountName) { + return getEmptyWithServiceResponseAsync(accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param accountName Account Name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getEmptyWithServiceResponseAsync(String accountName) { + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.host() == null) { + throw new IllegalArgumentException("Parameter this.client.host() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{accountName}", accountName, "{host}", this.client.host()); + return service.getEmpty(parameterizedHost) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/package-info.java new file mode 100644 index 0000000000..9449c1aeeb --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestParameterizedHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseuri.implementation; diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/models/Error.java b/test/vanilla/src/main/java/fixtures/custombaseuri/models/Error.java new file mode 100644 index 0000000000..1b960f8dd2 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/custombaseuri/models/ErrorException.java new file mode 100644 index 0000000000..8ecc6a0460 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseuri.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/models/package-info.java b/test/vanilla/src/main/java/fixtures/custombaseuri/models/package-info.java new file mode 100644 index 0000000000..22f43a6215 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestParameterizedHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseuri.models; diff --git a/test/vanilla/src/main/java/fixtures/custombaseuri/package-info.java b/test/vanilla/src/main/java/fixtures/custombaseuri/package-info.java new file mode 100644 index 0000000000..b604c7cd9f --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseuri/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestParameterizedHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseuri; diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClient.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClient.java new file mode 100644 index 0000000000..1f10af9145 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/AutoRestParameterizedCustomHostTestClient.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseurimoreoptions; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestParameterizedCustomHostTestClient class. + */ +public interface AutoRestParameterizedCustomHostTestClient { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "https://{vault}{secret}{dnsSuffix}"; + + /** + * Gets The subscription id with value 'test12'.. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Sets The subscription id with value 'test12'.. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + AutoRestParameterizedCustomHostTestClient withSubscriptionId(String subscriptionId); + + /** + * Gets A string value that is used as a global part of the parameterized host. Default value 'host'.. + * + * @return the dnsSuffix value. + */ + String dnsSuffix(); + + /** + * Sets A string value that is used as a global part of the parameterized host. Default value 'host'.. + * + * @param dnsSuffix the dnsSuffix value. + * @return the service client itself + */ + AutoRestParameterizedCustomHostTestClient withDnsSuffix(String dnsSuffix); + + /** + * Gets the Paths object to access its operations. + * @return the Paths object. + */ + Paths paths(); + +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/Paths.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/Paths.java new file mode 100644 index 0000000000..931b760c86 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/Paths.java @@ -0,0 +1,120 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseurimoreoptions; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.custombaseurimoreoptions.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public interface Paths { + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getEmpty(String vault, String secret, String keyName); + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(String vault, String secret, String keyName, final ServiceCallback serviceCallback); + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getEmptyAsync(String vault, String secret, String keyName); + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getEmptyWithServiceResponseAsync(String vault, String secret, String keyName); + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getEmpty(String vault, String secret, String keyName, String keyVersion); + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyAsync(String vault, String secret, String keyName, String keyVersion, final ServiceCallback serviceCallback); + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getEmptyAsync(String vault, String secret, String keyName, String keyVersion); + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getEmptyWithServiceResponseAsync(String vault, String secret, String keyName, String keyVersion); + +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/AutoRestParameterizedCustomHostTestClientImpl.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/AutoRestParameterizedCustomHostTestClientImpl.java new file mode 100644 index 0000000000..0eb97b85da --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/AutoRestParameterizedCustomHostTestClientImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseurimoreoptions.implementation; + +import fixtures.custombaseurimoreoptions.AutoRestParameterizedCustomHostTestClient; +import fixtures.custombaseurimoreoptions.Paths; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestParameterizedCustomHostTestClient class. + */ +public class AutoRestParameterizedCustomHostTestClientImpl extends ServiceClient implements AutoRestParameterizedCustomHostTestClient { + + /** The subscription id with value 'test12'. */ + private String subscriptionId; + + /** + * Gets The subscription id with value 'test12'. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The subscription id with value 'test12'. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AutoRestParameterizedCustomHostTestClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** A string value that is used as a global part of the parameterized host. Default value 'host'. */ + private String dnsSuffix; + + /** + * Gets A string value that is used as a global part of the parameterized host. Default value 'host'. + * + * @return the dnsSuffix value. + */ + public String dnsSuffix() { + return this.dnsSuffix; + } + + /** + * Sets A string value that is used as a global part of the parameterized host. Default value 'host'. + * + * @param dnsSuffix the dnsSuffix value. + * @return the service client itself + */ + public AutoRestParameterizedCustomHostTestClientImpl withDnsSuffix(String dnsSuffix) { + this.dnsSuffix = dnsSuffix; + return this; + } + + /** + * The Paths object to access its operations. + */ + private Paths paths; + + /** + * Gets the Paths object to access its operations. + * @return the Paths object. + */ + public Paths paths() { + return this.paths; + } + + /** + * Initializes an instance of AutoRestParameterizedCustomHostTestClient client. + */ + public AutoRestParameterizedCustomHostTestClientImpl() { + this("https://{vault}{secret}{dnsSuffix}"); + } + + /** + * Initializes an instance of AutoRestParameterizedCustomHostTestClient client. + * + * @param baseUrl the base URL of the host + */ + private AutoRestParameterizedCustomHostTestClientImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedCustomHostTestClient client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestParameterizedCustomHostTestClientImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("https://{vault}{secret}{dnsSuffix}", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedCustomHostTestClient client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + private AutoRestParameterizedCustomHostTestClientImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterizedCustomHostTestClient client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestParameterizedCustomHostTestClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.dnsSuffix = "host"; + this.paths = new PathsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/PathsImpl.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/PathsImpl.java new file mode 100644 index 0000000000..00f9027930 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/PathsImpl.java @@ -0,0 +1,248 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseurimoreoptions.implementation; + +import retrofit2.Retrofit; +import fixtures.custombaseurimoreoptions.Paths; +import com.google.common.base.Joiner; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.custombaseurimoreoptions.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public class PathsImpl implements Paths { + /** The Retrofit service to perform REST calls. */ + private PathsService service; + /** The service client containing this operation class. */ + private AutoRestParameterizedCustomHostTestClientImpl client; + + /** + * Initializes an instance of Paths. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PathsImpl(Retrofit retrofit, AutoRestParameterizedCustomHostTestClientImpl client) { + this.service = retrofit.create(PathsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Paths to be + * used by Retrofit to perform actually REST calls. + */ + interface PathsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.custombaseurimoreoptions.Paths getEmpty" }) + @GET("customuri/{subscriptionId}/{keyName}") + Observable> getEmpty(@Path("keyName") String keyName, @Path("subscriptionId") String subscriptionId, @Query("keyVersion") String keyVersion, @Header("x-ms-parameterized-host") String parameterizedHost); + + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getEmpty(String vault, String secret, String keyName) { + getEmptyWithServiceResponseAsync(vault, secret, keyName).toBlocking().single().body(); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(String vault, String secret, String keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(vault, secret, keyName), serviceCallback); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getEmptyAsync(String vault, String secret, String keyName) { + return getEmptyWithServiceResponseAsync(vault, secret, keyName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getEmptyWithServiceResponseAsync(String vault, String secret, String keyName) { + if (vault == null) { + throw new IllegalArgumentException("Parameter vault is required and cannot be null."); + } + if (secret == null) { + throw new IllegalArgumentException("Parameter secret is required and cannot be null."); + } + if (this.client.dnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.dnsSuffix() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String keyVersion = null; + String parameterizedHost = Joiner.on(", ").join("{vault}", vault, "{secret}", secret, "{dnsSuffix}", this.client.dnsSuffix()); + return service.getEmpty(keyName, this.client.subscriptionId(), keyVersion, parameterizedHost) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getEmpty(String vault, String secret, String keyName, String keyVersion) { + getEmptyWithServiceResponseAsync(vault, secret, keyName, keyVersion).toBlocking().single().body(); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyAsync(String vault, String secret, String keyName, String keyVersion, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyWithServiceResponseAsync(vault, secret, keyName, keyVersion), serviceCallback); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getEmptyAsync(String vault, String secret, String keyName, String keyVersion) { + return getEmptyWithServiceResponseAsync(vault, secret, keyName, keyVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a 200 to test a valid base uri. + * + * @param vault The vault name, e.g. https://myvault + * @param secret Secret value. + * @param keyName The key name with value 'key1'. + * @param keyVersion The key version. Default value 'v1'. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getEmptyWithServiceResponseAsync(String vault, String secret, String keyName, String keyVersion) { + if (vault == null) { + throw new IllegalArgumentException("Parameter vault is required and cannot be null."); + } + if (secret == null) { + throw new IllegalArgumentException("Parameter secret is required and cannot be null."); + } + if (this.client.dnsSuffix() == null) { + throw new IllegalArgumentException("Parameter this.client.dnsSuffix() is required and cannot be null."); + } + if (keyName == null) { + throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + String parameterizedHost = Joiner.on(", ").join("{vault}", vault, "{secret}", secret, "{dnsSuffix}", this.client.dnsSuffix()); + return service.getEmpty(keyName, this.client.subscriptionId(), keyVersion, parameterizedHost) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/package-info.java new file mode 100644 index 0000000000..01d064921d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestParameterizedCustomHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseurimoreoptions.implementation; diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/Error.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/Error.java new file mode 100644 index 0000000000..175aa37694 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseurimoreoptions.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/ErrorException.java new file mode 100644 index 0000000000..8f957b3946 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.custombaseurimoreoptions.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/package-info.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/package-info.java new file mode 100644 index 0000000000..2d0c4f8f35 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestParameterizedCustomHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseurimoreoptions.models; diff --git a/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/package-info.java b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/package-info.java new file mode 100644 index 0000000000..a6434083eb --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/custombaseurimoreoptions/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestParameterizedCustomHostTestClient. + * Test Infrastructure for AutoRest. + */ +package fixtures.custombaseurimoreoptions; diff --git a/test/vanilla/src/main/java/fixtures/header/AutoRestSwaggerBATHeaderService.java b/test/vanilla/src/main/java/fixtures/header/AutoRestSwaggerBATHeaderService.java new file mode 100644 index 0000000000..aa8be88768 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/AutoRestSwaggerBATHeaderService.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestSwaggerBATHeaderService class. + */ +public interface AutoRestSwaggerBATHeaderService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the Headers object to access its operations. + * @return the Headers object. + */ + Headers headers(); + +} diff --git a/test/vanilla/src/main/java/fixtures/header/Headers.java b/test/vanilla/src/main/java/fixtures/header/Headers.java new file mode 100644 index 0000000000..e6020fa4f0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/Headers.java @@ -0,0 +1,1293 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.header.models.ErrorException; +import fixtures.header.models.GreyscaleColors; +import fixtures.header.models.HeaderResponseBoolHeaders; +import fixtures.header.models.HeaderResponseByteHeaders; +import fixtures.header.models.HeaderResponseDateHeaders; +import fixtures.header.models.HeaderResponseDatetimeHeaders; +import fixtures.header.models.HeaderResponseDatetimeRfc1123Headers; +import fixtures.header.models.HeaderResponseDoubleHeaders; +import fixtures.header.models.HeaderResponseDurationHeaders; +import fixtures.header.models.HeaderResponseEnumHeaders; +import fixtures.header.models.HeaderResponseExistingKeyHeaders; +import fixtures.header.models.HeaderResponseFloatHeaders; +import fixtures.header.models.HeaderResponseIntegerHeaders; +import fixtures.header.models.HeaderResponseLongHeaders; +import fixtures.header.models.HeaderResponseProtectedKeyHeaders; +import fixtures.header.models.HeaderResponseStringHeaders; +import java.io.IOException; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Headers. + */ +public interface Headers { + /** + * Send a post request with header value "User-Agent": "overwrite". + * + * @param userAgent Send a post request with header value "User-Agent": "overwrite" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramExistingKey(String userAgent); + + /** + * Send a post request with header value "User-Agent": "overwrite". + * + * @param userAgent Send a post request with header value "User-Agent": "overwrite" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramExistingKeyAsync(String userAgent, final ServiceCallback serviceCallback); + + /** + * Send a post request with header value "User-Agent": "overwrite". + * + * @param userAgent Send a post request with header value "User-Agent": "overwrite" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramExistingKeyAsync(String userAgent); + + /** + * Send a post request with header value "User-Agent": "overwrite". + * + * @param userAgent Send a post request with header value "User-Agent": "overwrite" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramExistingKeyWithServiceResponseAsync(String userAgent); + + /** + * Get a response with header value "User-Agent": "overwrite". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseExistingKey(); + + /** + * Get a response with header value "User-Agent": "overwrite". + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseExistingKeyAsync(final ServiceCallback serviceCallback); + + /** + * Get a response with header value "User-Agent": "overwrite". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseExistingKeyAsync(); + + /** + * Get a response with header value "User-Agent": "overwrite". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseExistingKeyWithServiceResponseAsync(); + + /** + * Send a post request with header value "Content-Type": "text/html". + * + * @param contentType Send a post request with header value "Content-Type": "text/html" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramProtectedKey(String contentType); + + /** + * Send a post request with header value "Content-Type": "text/html". + * + * @param contentType Send a post request with header value "Content-Type": "text/html" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramProtectedKeyAsync(String contentType, final ServiceCallback serviceCallback); + + /** + * Send a post request with header value "Content-Type": "text/html". + * + * @param contentType Send a post request with header value "Content-Type": "text/html" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramProtectedKeyAsync(String contentType); + + /** + * Send a post request with header value "Content-Type": "text/html". + * + * @param contentType Send a post request with header value "Content-Type": "text/html" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramProtectedKeyWithServiceResponseAsync(String contentType); + + /** + * Get a response with header value "Content-Type": "text/html". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseProtectedKey(); + + /** + * Get a response with header value "Content-Type": "text/html". + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseProtectedKeyAsync(final ServiceCallback serviceCallback); + + /** + * Get a response with header value "Content-Type": "text/html". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseProtectedKeyAsync(); + + /** + * Get a response with header value "Content-Type": "text/html". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseProtectedKeyWithServiceResponseAsync(); + + /** + * Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 1 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramInteger(String scenario, int value); + + /** + * Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 1 or -2 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramIntegerAsync(String scenario, int value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 1 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramIntegerAsync(String scenario, int value); + + /** + * Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 1 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramIntegerWithServiceResponseAsync(String scenario, int value); + + /** + * Get a response with header value "value": 1 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseInteger(String scenario); + + /** + * Get a response with header value "value": 1 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseIntegerAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header value "value": 1 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseIntegerAsync(String scenario); + + /** + * Get a response with header value "value": 1 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseIntegerWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 105 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramLong(String scenario, long value); + + /** + * Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 105 or -2 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramLongAsync(String scenario, long value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 105 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramLongAsync(String scenario, long value); + + /** + * Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 105 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramLongWithServiceResponseAsync(String scenario, long value); + + /** + * Get a response with header value "value": 105 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseLong(String scenario); + + /** + * Get a response with header value "value": 105 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseLongAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header value "value": 105 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseLongAsync(String scenario); + + /** + * Get a response with header value "value": 105 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseLongWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 0.07 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramFloat(String scenario, double value); + + /** + * Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 0.07 or -3.0 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramFloatAsync(String scenario, double value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 0.07 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramFloatAsync(String scenario, double value); + + /** + * Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 0.07 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramFloatWithServiceResponseAsync(String scenario, double value); + + /** + * Get a response with header value "value": 0.07 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseFloat(String scenario); + + /** + * Get a response with header value "value": 0.07 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseFloatAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header value "value": 0.07 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseFloatAsync(String scenario); + + /** + * Get a response with header value "value": 0.07 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseFloatWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 7e120 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramDouble(String scenario, double value); + + /** + * Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 7e120 or -3.0 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramDoubleAsync(String scenario, double value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 7e120 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramDoubleAsync(String scenario, double value); + + /** + * Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 7e120 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramDoubleWithServiceResponseAsync(String scenario, double value); + + /** + * Get a response with header value "value": 7e120 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseDouble(String scenario); + + /** + * Get a response with header value "value": 7e120 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseDoubleAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header value "value": 7e120 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseDoubleAsync(String scenario); + + /** + * Get a response with header value "value": 7e120 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseDoubleWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param value Send a post request with header values true or false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramBool(String scenario, boolean value); + + /** + * Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param value Send a post request with header values true or false + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramBoolAsync(String scenario, boolean value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param value Send a post request with header values true or false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramBoolAsync(String scenario, boolean value); + + /** + * Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param value Send a post request with header values true or false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramBoolWithServiceResponseAsync(String scenario, boolean value); + + /** + * Get a response with header value "value": true or false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseBool(String scenario); + + /** + * Get a response with header value "value": true or false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseBoolAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header value "value": true or false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseBoolAsync(String scenario); + + /** + * Get a response with header value "value": true or false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseBoolWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramString(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramStringAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramStringAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramStringWithServiceResponseAsync(String scenario); + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramString(String scenario, String value); + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramStringAsync(String scenario, String value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramStringAsync(String scenario, String value); + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramStringWithServiceResponseAsync(String scenario, String value); + + /** + * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseString(String scenario); + + /** + * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseStringAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseStringAsync(String scenario); + + /** + * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseStringWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01" or "0001-01-01" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramDate(String scenario, LocalDate value); + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01" or "0001-01-01" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramDateAsync(String scenario, LocalDate value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01" or "0001-01-01" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramDateAsync(String scenario, LocalDate value); + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01" or "0001-01-01" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramDateWithServiceResponseAsync(String scenario, LocalDate value); + + /** + * Get a response with header values "2010-01-01" or "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseDate(String scenario); + + /** + * Get a response with header values "2010-01-01" or "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseDateAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header values "2010-01-01" or "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseDateAsync(String scenario); + + /** + * Get a response with header values "2010-01-01" or "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseDateWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramDatetime(String scenario, DateTime value); + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramDatetimeAsync(String scenario, DateTime value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramDatetimeAsync(String scenario, DateTime value); + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramDatetimeWithServiceResponseAsync(String scenario, DateTime value); + + /** + * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseDatetime(String scenario); + + /** + * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseDatetimeAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseDatetimeAsync(String scenario); + + /** + * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseDatetimeWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramDatetimeRfc1123(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramDatetimeRfc1123Async(String scenario, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramDatetimeRfc1123Async(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramDatetimeRfc1123WithServiceResponseAsync(String scenario); + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramDatetimeRfc1123(String scenario, DateTime value); + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramDatetimeRfc1123Async(String scenario, DateTime value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramDatetimeRfc1123Async(String scenario, DateTime value); + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramDatetimeRfc1123WithServiceResponseAsync(String scenario, DateTime value); + + /** + * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseDatetimeRfc1123(String scenario); + + /** + * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseDatetimeRfc1123Async(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseDatetimeRfc1123Async(String scenario); + + /** + * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseDatetimeRfc1123WithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "P123DT22H14M12.011S" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramDuration(String scenario, Period value); + + /** + * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "P123DT22H14M12.011S" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramDurationAsync(String scenario, Period value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "P123DT22H14M12.011S" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramDurationAsync(String scenario, Period value); + + /** + * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "P123DT22H14M12.011S" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramDurationWithServiceResponseAsync(String scenario, Period value); + + /** + * Get a response with header values "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseDuration(String scenario); + + /** + * Get a response with header values "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseDurationAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header values "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseDurationAsync(String scenario); + + /** + * Get a response with header values "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseDurationWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramByte(String scenario, byte[] value); + + /** + * Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramByteAsync(String scenario, byte[] value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramByteAsync(String scenario, byte[] value); + + /** + * Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramByteWithServiceResponseAsync(String scenario, byte[] value); + + /** + * Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseByte(String scenario); + + /** + * Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseByteAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseByteAsync(String scenario); + + /** + * Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseByteWithServiceResponseAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramEnum(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramEnumAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramEnumAsync(String scenario); + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramEnumWithServiceResponseAsync(String scenario); + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values 'GREY'. Possible values include: 'White', 'black', 'GREY' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void paramEnum(String scenario, GreyscaleColors value); + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values 'GREY'. Possible values include: 'White', 'black', 'GREY' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture paramEnumAsync(String scenario, GreyscaleColors value, final ServiceCallback serviceCallback); + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values 'GREY'. Possible values include: 'White', 'black', 'GREY' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable paramEnumAsync(String scenario, GreyscaleColors value); + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values 'GREY'. Possible values include: 'White', 'black', 'GREY' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> paramEnumWithServiceResponseAsync(String scenario, GreyscaleColors value); + + /** + * Get a response with header values "GREY" or null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void responseEnum(String scenario); + + /** + * Get a response with header values "GREY" or null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture responseEnumAsync(String scenario, final ServiceCallback serviceCallback); + + /** + * Get a response with header values "GREY" or null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable responseEnumAsync(String scenario); + + /** + * Get a response with header values "GREY" or null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> responseEnumWithServiceResponseAsync(String scenario); + + /** + * Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void customRequestId(); + + /** + * Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture customRequestIdAsync(final ServiceCallback serviceCallback); + + /** + * Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable customRequestIdAsync(); + + /** + * Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> customRequestIdWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/header/implementation/AutoRestSwaggerBATHeaderServiceImpl.java b/test/vanilla/src/main/java/fixtures/header/implementation/AutoRestSwaggerBATHeaderServiceImpl.java new file mode 100644 index 0000000000..cfa22932d4 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/implementation/AutoRestSwaggerBATHeaderServiceImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.implementation; + +import fixtures.header.AutoRestSwaggerBATHeaderService; +import fixtures.header.Headers; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestSwaggerBATHeaderService class. + */ +public class AutoRestSwaggerBATHeaderServiceImpl extends ServiceClient implements AutoRestSwaggerBATHeaderService { + + /** + * The Headers object to access its operations. + */ + private Headers headers; + + /** + * Gets the Headers object to access its operations. + * @return the Headers object. + */ + public Headers headers() { + return this.headers; + } + + /** + * Initializes an instance of AutoRestSwaggerBATHeaderService client. + */ + public AutoRestSwaggerBATHeaderServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestSwaggerBATHeaderService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestSwaggerBATHeaderServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATHeaderService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATHeaderServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATHeaderService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestSwaggerBATHeaderServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestSwaggerBATHeaderService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestSwaggerBATHeaderServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.headers = new HeadersImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/header/implementation/HeadersImpl.java b/test/vanilla/src/main/java/fixtures/header/implementation/HeadersImpl.java new file mode 100644 index 0000000000..29ebe55b5c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/implementation/HeadersImpl.java @@ -0,0 +1,2527 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.DateTimeRfc1123; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.header.models.ErrorException; +import fixtures.header.models.GreyscaleColors; +import fixtures.header.models.HeaderResponseBoolHeaders; +import fixtures.header.models.HeaderResponseByteHeaders; +import fixtures.header.models.HeaderResponseDateHeaders; +import fixtures.header.models.HeaderResponseDatetimeHeaders; +import fixtures.header.models.HeaderResponseDatetimeRfc1123Headers; +import fixtures.header.models.HeaderResponseDoubleHeaders; +import fixtures.header.models.HeaderResponseDurationHeaders; +import fixtures.header.models.HeaderResponseEnumHeaders; +import fixtures.header.models.HeaderResponseExistingKeyHeaders; +import fixtures.header.models.HeaderResponseFloatHeaders; +import fixtures.header.models.HeaderResponseIntegerHeaders; +import fixtures.header.models.HeaderResponseLongHeaders; +import fixtures.header.models.HeaderResponseProtectedKeyHeaders; +import fixtures.header.models.HeaderResponseStringHeaders; +import java.io.IOException; +import okhttp3.ResponseBody; +import org.apache.commons.codec.binary.Base64; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Headers. + */ +public class HeadersImpl implements fixtures.header.Headers { + /** The Retrofit service to perform REST calls. */ + private HeadersService service; + /** The service client containing this operation class. */ + private AutoRestSwaggerBATHeaderServiceImpl client; + + /** + * Initializes an instance of Headers. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HeadersImpl(Retrofit retrofit, AutoRestSwaggerBATHeaderServiceImpl client) { + this.service = retrofit.create(HeadersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Headers to be + * used by Retrofit to perform actually REST calls. + */ + interface HeadersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramExistingKey" }) + @POST("header/param/existingkey") + Observable> paramExistingKey(@Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseExistingKey" }) + @POST("header/response/existingkey") + Observable> responseExistingKey(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramProtectedKey" }) + @POST("header/param/protectedkey") + Observable> paramProtectedKey(@Header("Content-Type") String contentType); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseProtectedKey" }) + @POST("header/response/protectedkey") + Observable> responseProtectedKey(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramInteger" }) + @POST("header/param/prim/integer") + Observable> paramInteger(@Header("scenario") String scenario, @Header("value") int value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseInteger" }) + @POST("header/response/prim/integer") + Observable> responseInteger(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramLong" }) + @POST("header/param/prim/long") + Observable> paramLong(@Header("scenario") String scenario, @Header("value") long value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseLong" }) + @POST("header/response/prim/long") + Observable> responseLong(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramFloat" }) + @POST("header/param/prim/float") + Observable> paramFloat(@Header("scenario") String scenario, @Header("value") double value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseFloat" }) + @POST("header/response/prim/float") + Observable> responseFloat(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramDouble" }) + @POST("header/param/prim/double") + Observable> paramDouble(@Header("scenario") String scenario, @Header("value") double value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseDouble" }) + @POST("header/response/prim/double") + Observable> responseDouble(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramBool" }) + @POST("header/param/prim/bool") + Observable> paramBool(@Header("scenario") String scenario, @Header("value") boolean value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseBool" }) + @POST("header/response/prim/bool") + Observable> responseBool(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramString" }) + @POST("header/param/prim/string") + Observable> paramString(@Header("scenario") String scenario, @Header("value") String value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseString" }) + @POST("header/response/prim/string") + Observable> responseString(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramDate" }) + @POST("header/param/prim/date") + Observable> paramDate(@Header("scenario") String scenario, @Header("value") LocalDate value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseDate" }) + @POST("header/response/prim/date") + Observable> responseDate(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramDatetime" }) + @POST("header/param/prim/datetime") + Observable> paramDatetime(@Header("scenario") String scenario, @Header("value") DateTime value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseDatetime" }) + @POST("header/response/prim/datetime") + Observable> responseDatetime(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramDatetimeRfc1123" }) + @POST("header/param/prim/datetimerfc1123") + Observable> paramDatetimeRfc1123(@Header("scenario") String scenario, @Header("value") DateTimeRfc1123 value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseDatetimeRfc1123" }) + @POST("header/response/prim/datetimerfc1123") + Observable> responseDatetimeRfc1123(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramDuration" }) + @POST("header/param/prim/duration") + Observable> paramDuration(@Header("scenario") String scenario, @Header("value") Period value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseDuration" }) + @POST("header/response/prim/duration") + Observable> responseDuration(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramByte" }) + @POST("header/param/prim/byte") + Observable> paramByte(@Header("scenario") String scenario, @Header("value") String value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseByte" }) + @POST("header/response/prim/byte") + Observable> responseByte(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers paramEnum" }) + @POST("header/param/prim/enum") + Observable> paramEnum(@Header("scenario") String scenario, @Header("value") GreyscaleColors value); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers responseEnum" }) + @POST("header/response/prim/enum") + Observable> responseEnum(@Header("scenario") String scenario); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.header.Headers customRequestId" }) + @POST("header/custom/x-ms-client-request-id/9C4D50EE-2D56-4CD3-8152-34347DC9F2B0") + Observable> customRequestId(); + + } + + /** + * Send a post request with header value "User-Agent": "overwrite". + * + * @param userAgent Send a post request with header value "User-Agent": "overwrite" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramExistingKey(String userAgent) { + paramExistingKeyWithServiceResponseAsync(userAgent).toBlocking().single().body(); + } + + /** + * Send a post request with header value "User-Agent": "overwrite". + * + * @param userAgent Send a post request with header value "User-Agent": "overwrite" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramExistingKeyAsync(String userAgent, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramExistingKeyWithServiceResponseAsync(userAgent), serviceCallback); + } + + /** + * Send a post request with header value "User-Agent": "overwrite". + * + * @param userAgent Send a post request with header value "User-Agent": "overwrite" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramExistingKeyAsync(String userAgent) { + return paramExistingKeyWithServiceResponseAsync(userAgent).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header value "User-Agent": "overwrite". + * + * @param userAgent Send a post request with header value "User-Agent": "overwrite" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramExistingKeyWithServiceResponseAsync(String userAgent) { + if (userAgent == null) { + throw new IllegalArgumentException("Parameter userAgent is required and cannot be null."); + } + return service.paramExistingKey(userAgent) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramExistingKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramExistingKeyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header value "User-Agent": "overwrite". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseExistingKey() { + responseExistingKeyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a response with header value "User-Agent": "overwrite". + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseExistingKeyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseExistingKeyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a response with header value "User-Agent": "overwrite". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseExistingKeyAsync() { + return responseExistingKeyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header value "User-Agent": "overwrite". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseExistingKeyWithServiceResponseAsync() { + return service.responseExistingKey() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseExistingKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseExistingKeyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseExistingKeyHeaders.class); + } + + /** + * Send a post request with header value "Content-Type": "text/html". + * + * @param contentType Send a post request with header value "Content-Type": "text/html" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramProtectedKey(String contentType) { + paramProtectedKeyWithServiceResponseAsync(contentType).toBlocking().single().body(); + } + + /** + * Send a post request with header value "Content-Type": "text/html". + * + * @param contentType Send a post request with header value "Content-Type": "text/html" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramProtectedKeyAsync(String contentType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramProtectedKeyWithServiceResponseAsync(contentType), serviceCallback); + } + + /** + * Send a post request with header value "Content-Type": "text/html". + * + * @param contentType Send a post request with header value "Content-Type": "text/html" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramProtectedKeyAsync(String contentType) { + return paramProtectedKeyWithServiceResponseAsync(contentType).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header value "Content-Type": "text/html". + * + * @param contentType Send a post request with header value "Content-Type": "text/html" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramProtectedKeyWithServiceResponseAsync(String contentType) { + if (contentType == null) { + throw new IllegalArgumentException("Parameter contentType is required and cannot be null."); + } + return service.paramProtectedKey(contentType) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramProtectedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramProtectedKeyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header value "Content-Type": "text/html". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseProtectedKey() { + responseProtectedKeyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a response with header value "Content-Type": "text/html". + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseProtectedKeyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseProtectedKeyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a response with header value "Content-Type": "text/html". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseProtectedKeyAsync() { + return responseProtectedKeyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header value "Content-Type": "text/html". + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseProtectedKeyWithServiceResponseAsync() { + return service.responseProtectedKey() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseProtectedKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseProtectedKeyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseProtectedKeyHeaders.class); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 1 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramInteger(String scenario, int value) { + paramIntegerWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 1 or -2 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramIntegerAsync(String scenario, int value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramIntegerWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 1 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramIntegerAsync(String scenario, int value) { + return paramIntegerWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 1 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 1 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramIntegerWithServiceResponseAsync(String scenario, int value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.paramInteger(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramIntegerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramIntegerDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header value "value": 1 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseInteger(String scenario) { + responseIntegerWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header value "value": 1 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseIntegerAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseIntegerWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header value "value": 1 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseIntegerAsync(String scenario) { + return responseIntegerWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header value "value": 1 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseIntegerWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseInteger(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseIntegerDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseIntegerDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseIntegerHeaders.class); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 105 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramLong(String scenario, long value) { + paramLongWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 105 or -2 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramLongAsync(String scenario, long value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramLongWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 105 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramLongAsync(String scenario, long value) { + return paramLongWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 105 or "scenario": "negative", "value": -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 105 or -2 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramLongWithServiceResponseAsync(String scenario, long value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.paramLong(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramLongDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramLongDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header value "value": 105 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseLong(String scenario) { + responseLongWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header value "value": 105 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseLongAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseLongWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header value "value": 105 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseLongAsync(String scenario) { + return responseLongWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header value "value": 105 or -2. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseLongWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseLong(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseLongDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseLongDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseLongHeaders.class); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 0.07 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramFloat(String scenario, double value) { + paramFloatWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 0.07 or -3.0 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramFloatAsync(String scenario, double value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramFloatWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 0.07 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramFloatAsync(String scenario, double value) { + return paramFloatWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 0.07 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 0.07 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramFloatWithServiceResponseAsync(String scenario, double value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.paramFloat(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramFloatDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header value "value": 0.07 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseFloat(String scenario) { + responseFloatWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header value "value": 0.07 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseFloatAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseFloatWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header value "value": 0.07 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseFloatAsync(String scenario) { + return responseFloatWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header value "value": 0.07 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseFloatWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseFloat(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseFloatDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseFloatDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseFloatHeaders.class); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 7e120 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramDouble(String scenario, double value) { + paramDoubleWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 7e120 or -3.0 + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramDoubleAsync(String scenario, double value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramDoubleWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 7e120 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramDoubleAsync(String scenario, double value) { + return paramDoubleWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "positive", "value": 7e120 or "scenario": "negative", "value": -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param value Send a post request with header values 7e120 or -3.0 + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramDoubleWithServiceResponseAsync(String scenario, double value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.paramDouble(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramDoubleDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header value "value": 7e120 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseDouble(String scenario) { + responseDoubleWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header value "value": 7e120 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseDoubleAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseDoubleWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header value "value": 7e120 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseDoubleAsync(String scenario) { + return responseDoubleWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header value "value": 7e120 or -3.0. + * + * @param scenario Send a post request with header values "scenario": "positive" or "negative" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseDoubleWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseDouble(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseDoubleDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseDoubleDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseDoubleHeaders.class); + } + + /** + * Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param value Send a post request with header values true or false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramBool(String scenario, boolean value) { + paramBoolWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param value Send a post request with header values true or false + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramBoolAsync(String scenario, boolean value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramBoolWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param value Send a post request with header values true or false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramBoolAsync(String scenario, boolean value) { + return paramBoolWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "true", "value": true or "scenario": "false", "value": false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param value Send a post request with header values true or false + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramBoolWithServiceResponseAsync(String scenario, boolean value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.paramBool(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramBoolDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramBoolDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header value "value": true or false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseBool(String scenario) { + responseBoolWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header value "value": true or false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseBoolAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseBoolWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header value "value": true or false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseBoolAsync(String scenario) { + return responseBoolWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header value "value": true or false. + * + * @param scenario Send a post request with header values "scenario": "true" or "false" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseBoolWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseBool(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseBoolDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseBoolDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseBoolHeaders.class); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramString(String scenario) { + paramStringWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramStringAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramStringWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramStringAsync(String scenario) { + return paramStringWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramStringWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + final String value = null; + return service.paramString(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramString(String scenario, String value) { + paramStringWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramStringAsync(String scenario, String value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramStringWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramStringAsync(String scenario, String value) { + return paramStringWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "The quick brown fox jumps over the lazy dog" or "scenario": "null", "value": null or "scenario": "empty", "value": "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values "The quick brown fox jumps over the lazy dog" or null or "" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramStringWithServiceResponseAsync(String scenario, String value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.paramString(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramStringDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseString(String scenario) { + responseStringWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseStringAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseStringWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseStringAsync(String scenario) { + return responseStringWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header values "The quick brown fox jumps over the lazy dog" or null or "". + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseStringWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseString(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseStringDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseStringDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseStringHeaders.class); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01" or "0001-01-01" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramDate(String scenario, LocalDate value) { + paramDateWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01" or "0001-01-01" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramDateAsync(String scenario, LocalDate value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramDateWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01" or "0001-01-01" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramDateAsync(String scenario, LocalDate value) { + return paramDateWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01" or "scenario": "min", "value": "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01" or "0001-01-01" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramDateWithServiceResponseAsync(String scenario, LocalDate value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + return service.paramDate(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramDateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header values "2010-01-01" or "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseDate(String scenario) { + responseDateWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header values "2010-01-01" or "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseDateAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseDateWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header values "2010-01-01" or "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseDateAsync(String scenario) { + return responseDateWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header values "2010-01-01" or "0001-01-01". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseDateWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseDate(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseDateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseDateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseDateHeaders.class); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramDatetime(String scenario, DateTime value) { + paramDatetimeWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramDatetimeAsync(String scenario, DateTime value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramDatetimeWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramDatetimeAsync(String scenario, DateTime value) { + return paramDatetimeWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "2010-01-01T12:34:56Z" or "scenario": "min", "value": "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramDatetimeWithServiceResponseAsync(String scenario, DateTime value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + return service.paramDatetime(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramDatetimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramDatetimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseDatetime(String scenario) { + responseDatetimeWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseDatetimeAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseDatetimeWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseDatetimeAsync(String scenario) { + return responseDatetimeWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header values "2010-01-01T12:34:56Z" or "0001-01-01T00:00:00Z". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseDatetimeWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseDatetime(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseDatetimeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseDatetimeDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseDatetimeHeaders.class); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramDatetimeRfc1123(String scenario) { + paramDatetimeRfc1123WithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramDatetimeRfc1123Async(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramDatetimeRfc1123WithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramDatetimeRfc1123Async(String scenario) { + return paramDatetimeRfc1123WithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramDatetimeRfc1123WithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + final DateTime value = null; + DateTimeRfc1123 valueConverted = null; + if (value != null) { + valueConverted = new DateTimeRfc1123(value); + } + return service.paramDatetimeRfc1123(scenario, valueConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramDatetimeRfc1123Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramDatetimeRfc1123(String scenario, DateTime value) { + paramDatetimeRfc1123WithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramDatetimeRfc1123Async(String scenario, DateTime value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramDatetimeRfc1123WithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramDatetimeRfc1123Async(String scenario, DateTime value) { + return paramDatetimeRfc1123WithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "Wed, 01 Jan 2010 12:34:56 GMT" or "scenario": "min", "value": "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param value Send a post request with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramDatetimeRfc1123WithServiceResponseAsync(String scenario, DateTime value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + DateTimeRfc1123 valueConverted = null; + if (value != null) { + valueConverted = new DateTimeRfc1123(value); + } + return service.paramDatetimeRfc1123(scenario, valueConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramDatetimeRfc1123Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramDatetimeRfc1123Delegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseDatetimeRfc1123(String scenario) { + responseDatetimeRfc1123WithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseDatetimeRfc1123Async(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseDatetimeRfc1123WithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseDatetimeRfc1123Async(String scenario) { + return responseDatetimeRfc1123WithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 Jan 0001 00:00:00 GMT". + * + * @param scenario Send a post request with header values "scenario": "valid" or "min" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseDatetimeRfc1123WithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseDatetimeRfc1123(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseDatetimeRfc1123Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseDatetimeRfc1123Delegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseDatetimeRfc1123Headers.class); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "P123DT22H14M12.011S" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramDuration(String scenario, Period value) { + paramDurationWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "P123DT22H14M12.011S" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramDurationAsync(String scenario, Period value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramDurationWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "P123DT22H14M12.011S" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramDurationAsync(String scenario, Period value) { + return paramDurationWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "P123DT22H14M12.011S" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramDurationWithServiceResponseAsync(String scenario, Period value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + return service.paramDuration(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramDurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramDurationDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header values "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseDuration(String scenario) { + responseDurationWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header values "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseDurationAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseDurationWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header values "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseDurationAsync(String scenario) { + return responseDurationWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header values "P123DT22H14M12.011S". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseDurationWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseDuration(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseDurationDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseDurationDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseDurationHeaders.class); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramByte(String scenario, byte[] value) { + paramByteWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramByteAsync(String scenario, byte[] value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramByteWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramByteAsync(String scenario, byte[] value) { + return paramByteWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param value Send a post request with header values "啊齄丂狛狜隣郎隣兀﨩" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramByteWithServiceResponseAsync(String scenario, byte[] value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + if (value == null) { + throw new IllegalArgumentException("Parameter value is required and cannot be null."); + } + String valueConverted = Base64.encodeBase64String(value); + return service.paramByte(scenario, valueConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramByteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramByteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseByte(String scenario) { + responseByteWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseByteAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseByteWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseByteAsync(String scenario) { + return responseByteWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header values "啊齄丂狛狜隣郎隣兀﨩". + * + * @param scenario Send a post request with header values "scenario": "valid" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseByteWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseByte(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseByteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseByteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseByteHeaders.class); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramEnum(String scenario) { + paramEnumWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramEnumAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramEnumWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramEnumAsync(String scenario) { + return paramEnumWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramEnumWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + final GreyscaleColors value = null; + return service.paramEnum(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramEnumDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values 'GREY'. Possible values include: 'White', 'black', 'GREY' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void paramEnum(String scenario, GreyscaleColors value) { + paramEnumWithServiceResponseAsync(scenario, value).toBlocking().single().body(); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values 'GREY'. Possible values include: 'White', 'black', 'GREY' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture paramEnumAsync(String scenario, GreyscaleColors value, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(paramEnumWithServiceResponseAsync(scenario, value), serviceCallback); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values 'GREY'. Possible values include: 'White', 'black', 'GREY' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable paramEnumAsync(String scenario, GreyscaleColors value) { + return paramEnumWithServiceResponseAsync(scenario, value).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a post request with header values "scenario": "valid", "value": "GREY" or "scenario": "null", "value": null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param value Send a post request with header values 'GREY'. Possible values include: 'White', 'black', 'GREY' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> paramEnumWithServiceResponseAsync(String scenario, GreyscaleColors value) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.paramEnum(scenario, value) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = paramEnumDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse paramEnumDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a response with header values "GREY" or null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void responseEnum(String scenario) { + responseEnumWithServiceResponseAsync(scenario).toBlocking().single().body(); + } + + /** + * Get a response with header values "GREY" or null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture responseEnumAsync(String scenario, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(responseEnumWithServiceResponseAsync(scenario), serviceCallback); + } + + /** + * Get a response with header values "GREY" or null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable responseEnumAsync(String scenario) { + return responseEnumWithServiceResponseAsync(scenario).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Get a response with header values "GREY" or null. + * + * @param scenario Send a post request with header values "scenario": "valid" or "null" or "empty" + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> responseEnumWithServiceResponseAsync(String scenario) { + if (scenario == null) { + throw new IllegalArgumentException("Parameter scenario is required and cannot be null."); + } + return service.responseEnum(scenario) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = responseEnumDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders responseEnumDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HeaderResponseEnumHeaders.class); + } + + /** + * Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void customRequestId() { + customRequestIdWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture customRequestIdAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(customRequestIdWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable customRequestIdAsync() { + return customRequestIdWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send x-ms-client-request-id = 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0 in the header of the request. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> customRequestIdWithServiceResponseAsync() { + return service.customRequestId() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = customRequestIdDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse customRequestIdDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/header/implementation/package-info.java new file mode 100644 index 0000000000..15a0688d04 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestSwaggerBATHeaderService. + * Test Infrastructure for AutoRest. + */ +package fixtures.header.implementation; diff --git a/test/vanilla/src/main/java/fixtures/header/models/Error.java b/test/vanilla/src/main/java/fixtures/header/models/Error.java new file mode 100644 index 0000000000..4517814f2a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/header/models/ErrorException.java new file mode 100644 index 0000000000..5aaba19799 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/GreyscaleColors.java b/test/vanilla/src/main/java/fixtures/header/models/GreyscaleColors.java new file mode 100644 index 0000000000..538127558f --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/GreyscaleColors.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for GreyscaleColors. + */ +public enum GreyscaleColors { + /** Enum value White. */ + WHITE("White"), + + /** Enum value black. */ + BLACK("black"), + + /** Enum value GREY. */ + GREY("GREY"); + + /** The actual serialized value for a GreyscaleColors instance. */ + private String value; + + GreyscaleColors(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a GreyscaleColors instance. + * + * @param value the serialized value to parse. + * @return the parsed GreyscaleColors object, or null if unable to parse. + */ + @JsonCreator + public static GreyscaleColors fromString(String value) { + GreyscaleColors[] items = GreyscaleColors.values(); + for (GreyscaleColors item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseBoolHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseBoolHeaders.java new file mode 100644 index 0000000000..9aa4604f3e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseBoolHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseBool operation. + */ +public class HeaderResponseBoolHeaders { + /** + * response with header value "value": true or false. + */ + @JsonProperty(value = "value") + private Boolean value; + + /** + * Get the value value. + * + * @return the value value + */ + public Boolean value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseBoolHeaders object itself. + */ + public HeaderResponseBoolHeaders withValue(Boolean value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseByteHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseByteHeaders.java new file mode 100644 index 0000000000..66826a3967 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseByteHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseByte operation. + */ +public class HeaderResponseByteHeaders { + /** + * response with header values "啊齄丂狛狜隣郎隣兀﨩". + */ + @JsonProperty(value = "value") + private byte[] value; + + /** + * Get the value value. + * + * @return the value value + */ + public byte[] value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseByteHeaders object itself. + */ + public HeaderResponseByteHeaders withValue(byte[] value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDateHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDateHeaders.java new file mode 100644 index 0000000000..e4e8ab3a9f --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDateHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import org.joda.time.LocalDate; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseDate operation. + */ +public class HeaderResponseDateHeaders { + /** + * response with header values "2010-01-01" or "0001-01-01". + */ + @JsonProperty(value = "value") + private LocalDate value; + + /** + * Get the value value. + * + * @return the value value + */ + public LocalDate value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseDateHeaders object itself. + */ + public HeaderResponseDateHeaders withValue(LocalDate value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeHeaders.java new file mode 100644 index 0000000000..bb4c9d4120 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeHeaders.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseDatetime operation. + */ +public class HeaderResponseDatetimeHeaders { + /** + * response with header values "2010-01-01T12:34:56Z" or + * "0001-01-01T00:00:00Z". + */ + @JsonProperty(value = "value") + private DateTime value; + + /** + * Get the value value. + * + * @return the value value + */ + public DateTime value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseDatetimeHeaders object itself. + */ + public HeaderResponseDatetimeHeaders withValue(DateTime value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeRfc1123Headers.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeRfc1123Headers.java new file mode 100644 index 0000000000..9b32771db6 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDatetimeRfc1123Headers.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.microsoft.rest.DateTimeRfc1123; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseDatetimeRfc1123 operation. + */ +public class HeaderResponseDatetimeRfc1123Headers { + /** + * response with header values "Wed, 01 Jan 2010 12:34:56 GMT" or "Mon, 01 + * Jan 0001 00:00:00 GMT". + */ + @JsonProperty(value = "value") + private DateTimeRfc1123 value; + + /** + * Get the value value. + * + * @return the value value + */ + public DateTime value() { + if (this.value == null) { + return null; + } + return this.value.dateTime(); + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseDatetimeRfc1123Headers object itself. + */ + public HeaderResponseDatetimeRfc1123Headers withValue(DateTime value) { + if (value == null) { + this.value = null; + } else { + this.value = new DateTimeRfc1123(value); + } + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDoubleHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDoubleHeaders.java new file mode 100644 index 0000000000..2f72209344 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDoubleHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseDouble operation. + */ +public class HeaderResponseDoubleHeaders { + /** + * response with header value "value": 7e120 or -3.0. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the value value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseDoubleHeaders object itself. + */ + public HeaderResponseDoubleHeaders withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDurationHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDurationHeaders.java new file mode 100644 index 0000000000..b1b556aaee --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseDurationHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import org.joda.time.Period; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseDuration operation. + */ +public class HeaderResponseDurationHeaders { + /** + * response with header values "P123DT22H14M12.011S". + */ + @JsonProperty(value = "value") + private Period value; + + /** + * Get the value value. + * + * @return the value value + */ + public Period value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseDurationHeaders object itself. + */ + public HeaderResponseDurationHeaders withValue(Period value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseEnumHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseEnumHeaders.java new file mode 100644 index 0000000000..ca69b5b90a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseEnumHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseEnum operation. + */ +public class HeaderResponseEnumHeaders { + /** + * response with header values "GREY" or null. Possible values include: + * 'White', 'black', 'GREY'. + */ + @JsonProperty(value = "value") + private GreyscaleColors value; + + /** + * Get the value value. + * + * @return the value value + */ + public GreyscaleColors value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseEnumHeaders object itself. + */ + public HeaderResponseEnumHeaders withValue(GreyscaleColors value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseExistingKeyHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseExistingKeyHeaders.java new file mode 100644 index 0000000000..60008594b0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseExistingKeyHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseExistingKey operation. + */ +public class HeaderResponseExistingKeyHeaders { + /** + * response with header value "User-Agent": "overwrite". + */ + @JsonProperty(value = "User-Agent") + private String userAgent; + + /** + * Get the userAgent value. + * + * @return the userAgent value + */ + public String userAgent() { + return this.userAgent; + } + + /** + * Set the userAgent value. + * + * @param userAgent the userAgent value to set + * @return the HeaderResponseExistingKeyHeaders object itself. + */ + public HeaderResponseExistingKeyHeaders withUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseFloatHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseFloatHeaders.java new file mode 100644 index 0000000000..22c90548a3 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseFloatHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseFloat operation. + */ +public class HeaderResponseFloatHeaders { + /** + * response with header value "value": 0.07 or -3.0. + */ + @JsonProperty(value = "value") + private Double value; + + /** + * Get the value value. + * + * @return the value value + */ + public Double value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseFloatHeaders object itself. + */ + public HeaderResponseFloatHeaders withValue(Double value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseIntegerHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseIntegerHeaders.java new file mode 100644 index 0000000000..dc507d7630 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseIntegerHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseInteger operation. + */ +public class HeaderResponseIntegerHeaders { + /** + * response with header value "value": 1 or -2. + */ + @JsonProperty(value = "value") + private Integer value; + + /** + * Get the value value. + * + * @return the value value + */ + public Integer value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseIntegerHeaders object itself. + */ + public HeaderResponseIntegerHeaders withValue(Integer value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseLongHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseLongHeaders.java new file mode 100644 index 0000000000..cb7b283dc2 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseLongHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseLong operation. + */ +public class HeaderResponseLongHeaders { + /** + * response with header value "value": 105 or -2. + */ + @JsonProperty(value = "value") + private Long value; + + /** + * Get the value value. + * + * @return the value value + */ + public Long value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseLongHeaders object itself. + */ + public HeaderResponseLongHeaders withValue(Long value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseProtectedKeyHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseProtectedKeyHeaders.java new file mode 100644 index 0000000000..d601d9862d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseProtectedKeyHeaders.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseProtectedKey operation. + */ +public class HeaderResponseProtectedKeyHeaders { + /** + * response with header value "Content-Type": "text/html". + */ + @JsonProperty(value = "Content-Type") + private String contentType; + + /** + * Get the contentType value. + * + * @return the contentType value + */ + public String contentType() { + return this.contentType; + } + + /** + * Set the contentType value. + * + * @param contentType the contentType value to set + * @return the HeaderResponseProtectedKeyHeaders object itself. + */ + public HeaderResponseProtectedKeyHeaders withContentType(String contentType) { + this.contentType = contentType; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseStringHeaders.java b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseStringHeaders.java new file mode 100644 index 0000000000..49809664df --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/HeaderResponseStringHeaders.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.header.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for responseString operation. + */ +public class HeaderResponseStringHeaders { + /** + * response with header values "The quick brown fox jumps over the lazy + * dog" or null or "". + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the HeaderResponseStringHeaders object itself. + */ + public HeaderResponseStringHeaders withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/header/models/package-info.java b/test/vanilla/src/main/java/fixtures/header/models/package-info.java new file mode 100644 index 0000000000..fd5f044781 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestSwaggerBATHeaderService. + * Test Infrastructure for AutoRest. + */ +package fixtures.header.models; diff --git a/test/vanilla/src/main/java/fixtures/header/package-info.java b/test/vanilla/src/main/java/fixtures/header/package-info.java new file mode 100644 index 0000000000..682f60464e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/header/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestSwaggerBATHeaderService. + * Test Infrastructure for AutoRest. + */ +package fixtures.header; diff --git a/test/vanilla/src/main/java/fixtures/http/AutoRestHttpInfrastructureTestService.java b/test/vanilla/src/main/java/fixtures/http/AutoRestHttpInfrastructureTestService.java new file mode 100644 index 0000000000..b03e24279c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/AutoRestHttpInfrastructureTestService.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestHttpInfrastructureTestService class. + */ +public interface AutoRestHttpInfrastructureTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the HttpFailures object to access its operations. + * @return the HttpFailures object. + */ + HttpFailures httpFailures(); + + /** + * Gets the HttpSuccess object to access its operations. + * @return the HttpSuccess object. + */ + HttpSuccess httpSuccess(); + + /** + * Gets the HttpRedirects object to access its operations. + * @return the HttpRedirects object. + */ + HttpRedirects httpRedirects(); + + /** + * Gets the HttpClientFailures object to access its operations. + * @return the HttpClientFailures object. + */ + HttpClientFailures httpClientFailures(); + + /** + * Gets the HttpServerFailures object to access its operations. + * @return the HttpServerFailures object. + */ + HttpServerFailures httpServerFailures(); + + /** + * Gets the HttpRetrys object to access its operations. + * @return the HttpRetrys object. + */ + HttpRetrys httpRetrys(); + + /** + * Gets the MultipleResponses object to access its operations. + * @return the MultipleResponses object. + */ + MultipleResponses multipleResponses(); + +} diff --git a/test/vanilla/src/main/java/fixtures/http/HttpClientFailures.java b/test/vanilla/src/main/java/fixtures/http/HttpClientFailures.java new file mode 100644 index 0000000000..70973f1505 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/HttpClientFailures.java @@ -0,0 +1,1325 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.Error; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpClientFailures. + */ +public interface HttpClientFailures { + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error head400(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head400Async(final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable head400Async(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> head400WithServiceResponseAsync(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error get400(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get400Async(final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable get400Async(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> get400WithServiceResponseAsync(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error put400(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put400Async(final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable put400Async(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> put400WithServiceResponseAsync(); + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error put400(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put400Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable put400Async(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> put400WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error patch400(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch400Async(final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable patch400Async(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> patch400WithServiceResponseAsync(); + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error patch400(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch400Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable patch400Async(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> patch400WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error post400(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post400Async(final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable post400Async(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> post400WithServiceResponseAsync(); + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error post400(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post400Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable post400Async(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> post400WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error delete400(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete400Async(final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable delete400Async(); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> delete400WithServiceResponseAsync(); + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error delete400(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete400Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable delete400Async(Boolean booleanValue); + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> delete400WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 401 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error head401(); + + /** + * Return 401 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head401Async(final ServiceCallback serviceCallback); + + /** + * Return 401 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable head401Async(); + + /** + * Return 401 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> head401WithServiceResponseAsync(); + + /** + * Return 402 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error get402(); + + /** + * Return 402 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get402Async(final ServiceCallback serviceCallback); + + /** + * Return 402 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable get402Async(); + + /** + * Return 402 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> get402WithServiceResponseAsync(); + + /** + * Return 403 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error get403(); + + /** + * Return 403 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get403Async(final ServiceCallback serviceCallback); + + /** + * Return 403 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable get403Async(); + + /** + * Return 403 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> get403WithServiceResponseAsync(); + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error put404(); + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put404Async(final ServiceCallback serviceCallback); + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable put404Async(); + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> put404WithServiceResponseAsync(); + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error put404(Boolean booleanValue); + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put404Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable put404Async(Boolean booleanValue); + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> put404WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error patch405(); + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch405Async(final ServiceCallback serviceCallback); + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable patch405Async(); + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> patch405WithServiceResponseAsync(); + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error patch405(Boolean booleanValue); + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch405Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable patch405Async(Boolean booleanValue); + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> patch405WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error post406(); + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post406Async(final ServiceCallback serviceCallback); + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable post406Async(); + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> post406WithServiceResponseAsync(); + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error post406(Boolean booleanValue); + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post406Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable post406Async(Boolean booleanValue); + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> post406WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error delete407(); + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete407Async(final ServiceCallback serviceCallback); + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable delete407Async(); + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> delete407WithServiceResponseAsync(); + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error delete407(Boolean booleanValue); + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete407Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable delete407Async(Boolean booleanValue); + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> delete407WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error put409(); + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put409Async(final ServiceCallback serviceCallback); + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable put409Async(); + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> put409WithServiceResponseAsync(); + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error put409(Boolean booleanValue); + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put409Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable put409Async(Boolean booleanValue); + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> put409WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 410 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error head410(); + + /** + * Return 410 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head410Async(final ServiceCallback serviceCallback); + + /** + * Return 410 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable head410Async(); + + /** + * Return 410 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> head410WithServiceResponseAsync(); + + /** + * Return 411 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error get411(); + + /** + * Return 411 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get411Async(final ServiceCallback serviceCallback); + + /** + * Return 411 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable get411Async(); + + /** + * Return 411 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> get411WithServiceResponseAsync(); + + /** + * Return 412 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error get412(); + + /** + * Return 412 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get412Async(final ServiceCallback serviceCallback); + + /** + * Return 412 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable get412Async(); + + /** + * Return 412 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> get412WithServiceResponseAsync(); + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error put413(); + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put413Async(final ServiceCallback serviceCallback); + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable put413Async(); + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> put413WithServiceResponseAsync(); + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error put413(Boolean booleanValue); + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put413Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable put413Async(Boolean booleanValue); + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> put413WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error patch414(); + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch414Async(final ServiceCallback serviceCallback); + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable patch414Async(); + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> patch414WithServiceResponseAsync(); + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error patch414(Boolean booleanValue); + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch414Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable patch414Async(Boolean booleanValue); + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> patch414WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error post415(); + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post415Async(final ServiceCallback serviceCallback); + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable post415Async(); + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> post415WithServiceResponseAsync(); + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error post415(Boolean booleanValue); + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post415Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable post415Async(Boolean booleanValue); + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> post415WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 416 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error get416(); + + /** + * Return 416 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get416Async(final ServiceCallback serviceCallback); + + /** + * Return 416 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable get416Async(); + + /** + * Return 416 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> get416WithServiceResponseAsync(); + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error delete417(); + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete417Async(final ServiceCallback serviceCallback); + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable delete417Async(); + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> delete417WithServiceResponseAsync(); + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error delete417(Boolean booleanValue); + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete417Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable delete417Async(Boolean booleanValue); + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> delete417WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 429 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error head429(); + + /** + * Return 429 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head429Async(final ServiceCallback serviceCallback); + + /** + * Return 429 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable head429Async(); + + /** + * Return 429 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> head429WithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/http/HttpFailures.java b/test/vanilla/src/main/java/fixtures/http/HttpFailures.java new file mode 100644 index 0000000000..6de125bd42 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/HttpFailures.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http; + +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpFailures. + */ +public interface HttpFailures { + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean getEmptyError(); + + /** + * Get empty error form server. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getEmptyErrorAsync(final ServiceCallback serviceCallback); + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable getEmptyErrorAsync(); + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> getEmptyErrorWithServiceResponseAsync(); + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean getNoModelError(); + + /** + * Get empty error form server. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNoModelErrorAsync(final ServiceCallback serviceCallback); + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable getNoModelErrorAsync(); + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> getNoModelErrorWithServiceResponseAsync(); + + /** + * Get empty response from server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean getNoModelEmpty(); + + /** + * Get empty response from server. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNoModelEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get empty response from server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable getNoModelEmptyAsync(); + + /** + * Get empty response from server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> getNoModelEmptyWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/http/HttpRedirects.java b/test/vanilla/src/main/java/fixtures/http/HttpRedirects.java new file mode 100644 index 0000000000..c49b1a6e72 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/HttpRedirects.java @@ -0,0 +1,811 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.http.models.ErrorException; +import fixtures.http.models.HttpRedirectsDelete307Headers; +import fixtures.http.models.HttpRedirectsGet300Headers; +import fixtures.http.models.HttpRedirectsGet301Headers; +import fixtures.http.models.HttpRedirectsGet302Headers; +import fixtures.http.models.HttpRedirectsGet307Headers; +import fixtures.http.models.HttpRedirectsHead300Headers; +import fixtures.http.models.HttpRedirectsHead301Headers; +import fixtures.http.models.HttpRedirectsHead302Headers; +import fixtures.http.models.HttpRedirectsHead307Headers; +import fixtures.http.models.HttpRedirectsPatch302Headers; +import fixtures.http.models.HttpRedirectsPatch307Headers; +import fixtures.http.models.HttpRedirectsPost303Headers; +import fixtures.http.models.HttpRedirectsPost307Headers; +import fixtures.http.models.HttpRedirectsPut301Headers; +import fixtures.http.models.HttpRedirectsPut307Headers; +import java.io.IOException; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpRedirects. + */ +public interface HttpRedirects { + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head300(); + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head300Async(final ServiceCallback serviceCallback); + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable head300Async(); + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> head300WithServiceResponseAsync(); + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<String> object if successful. + */ + List get300(); + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> get300Async(final ServiceCallback> serviceCallback); + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + Observable> get300Async(); + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + Observable, HttpRedirectsGet300Headers>> get300WithServiceResponseAsync(); + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head301(); + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head301Async(final ServiceCallback serviceCallback); + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable head301Async(); + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> head301WithServiceResponseAsync(); + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get301(); + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get301Async(final ServiceCallback serviceCallback); + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable get301Async(); + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> get301WithServiceResponseAsync(); + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put301(); + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put301Async(final ServiceCallback serviceCallback); + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable put301Async(); + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> put301WithServiceResponseAsync(); + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put301(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put301Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable put301Async(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> put301WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head302(); + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head302Async(final ServiceCallback serviceCallback); + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable head302Async(); + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> head302WithServiceResponseAsync(); + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get302(); + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get302Async(final ServiceCallback serviceCallback); + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable get302Async(); + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> get302WithServiceResponseAsync(); + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch302(); + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch302Async(final ServiceCallback serviceCallback); + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable patch302Async(); + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> patch302WithServiceResponseAsync(); + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch302(Boolean booleanValue); + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch302Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable patch302Async(Boolean booleanValue); + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> patch302WithServiceResponseAsync(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post303(); + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post303Async(final ServiceCallback serviceCallback); + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post303Async(); + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post303WithServiceResponseAsync(); + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post303(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post303Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post303Async(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post303WithServiceResponseAsync(Boolean booleanValue); + + /** + * Redirect with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head307(); + + /** + * Redirect with 307, resulting in a 200 success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head307Async(final ServiceCallback serviceCallback); + + /** + * Redirect with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable head307Async(); + + /** + * Redirect with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> head307WithServiceResponseAsync(); + + /** + * Redirect get with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get307(); + + /** + * Redirect get with 307, resulting in a 200 success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get307Async(final ServiceCallback serviceCallback); + + /** + * Redirect get with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable get307Async(); + + /** + * Redirect get with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> get307WithServiceResponseAsync(); + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put307(); + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put307Async(final ServiceCallback serviceCallback); + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable put307Async(); + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> put307WithServiceResponseAsync(); + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put307(Boolean booleanValue); + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put307Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable put307Async(Boolean booleanValue); + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> put307WithServiceResponseAsync(Boolean booleanValue); + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch307(); + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch307Async(final ServiceCallback serviceCallback); + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable patch307Async(); + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> patch307WithServiceResponseAsync(); + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch307(Boolean booleanValue); + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch307Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable patch307Async(Boolean booleanValue); + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> patch307WithServiceResponseAsync(Boolean booleanValue); + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post307(); + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post307Async(final ServiceCallback serviceCallback); + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post307Async(); + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post307WithServiceResponseAsync(); + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post307(Boolean booleanValue); + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post307Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable post307Async(Boolean booleanValue); + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> post307WithServiceResponseAsync(Boolean booleanValue); + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete307(); + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete307Async(final ServiceCallback serviceCallback); + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable delete307Async(); + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> delete307WithServiceResponseAsync(); + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete307(Boolean booleanValue); + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete307Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable delete307Async(Boolean booleanValue); + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + Observable> delete307WithServiceResponseAsync(Boolean booleanValue); + +} diff --git a/test/vanilla/src/main/java/fixtures/http/HttpRetrys.java b/test/vanilla/src/main/java/fixtures/http/HttpRetrys.java new file mode 100644 index 0000000000..299d047b78 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/HttpRetrys.java @@ -0,0 +1,519 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpRetrys. + */ +public interface HttpRetrys { + /** + * Return 408 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head408(); + + /** + * Return 408 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head408Async(final ServiceCallback serviceCallback); + + /** + * Return 408 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable head408Async(); + + /** + * Return 408 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> head408WithServiceResponseAsync(); + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put500(); + + /** + * Return 500 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put500Async(final ServiceCallback serviceCallback); + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put500Async(); + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put500WithServiceResponseAsync(); + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put500(Boolean booleanValue); + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put500Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put500Async(Boolean booleanValue); + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put500WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch500(); + + /** + * Return 500 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch500Async(final ServiceCallback serviceCallback); + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch500Async(); + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch500WithServiceResponseAsync(); + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch500(Boolean booleanValue); + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch500Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch500Async(Boolean booleanValue); + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch500WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 502 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get502(); + + /** + * Return 502 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get502Async(final ServiceCallback serviceCallback); + + /** + * Return 502 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable get502Async(); + + /** + * Return 502 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> get502WithServiceResponseAsync(); + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post503(); + + /** + * Return 503 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post503Async(final ServiceCallback serviceCallback); + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post503Async(); + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post503WithServiceResponseAsync(); + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post503(Boolean booleanValue); + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post503Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post503Async(Boolean booleanValue); + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post503WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete503(); + + /** + * Return 503 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete503Async(final ServiceCallback serviceCallback); + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete503Async(); + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete503WithServiceResponseAsync(); + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete503(Boolean booleanValue); + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete503Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete503Async(Boolean booleanValue); + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete503WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put504(); + + /** + * Return 504 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put504Async(final ServiceCallback serviceCallback); + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put504Async(); + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put504WithServiceResponseAsync(); + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put504(Boolean booleanValue); + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put504Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put504Async(Boolean booleanValue); + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put504WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch504(); + + /** + * Return 504 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch504Async(final ServiceCallback serviceCallback); + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch504Async(); + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch504WithServiceResponseAsync(); + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch504(Boolean booleanValue); + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch504Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch504Async(Boolean booleanValue); + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch504WithServiceResponseAsync(Boolean booleanValue); + +} diff --git a/test/vanilla/src/main/java/fixtures/http/HttpServerFailures.java b/test/vanilla/src/main/java/fixtures/http/HttpServerFailures.java new file mode 100644 index 0000000000..4b374dc7a5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/HttpServerFailures.java @@ -0,0 +1,242 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.Error; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpServerFailures. + */ +public interface HttpServerFailures { + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error head501(); + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head501Async(final ServiceCallback serviceCallback); + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable head501Async(); + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> head501WithServiceResponseAsync(); + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error get501(); + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get501Async(final ServiceCallback serviceCallback); + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable get501Async(); + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> get501WithServiceResponseAsync(); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error post505(); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post505Async(final ServiceCallback serviceCallback); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable post505Async(); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> post505WithServiceResponseAsync(); + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error post505(Boolean booleanValue); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post505Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable post505Async(Boolean booleanValue); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> post505WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error delete505(); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete505Async(final ServiceCallback serviceCallback); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable delete505Async(); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> delete505WithServiceResponseAsync(); + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error delete505(Boolean booleanValue); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete505Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable delete505Async(Boolean booleanValue); + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> delete505WithServiceResponseAsync(Boolean booleanValue); + +} diff --git a/test/vanilla/src/main/java/fixtures/http/HttpSuccess.java b/test/vanilla/src/main/java/fixtures/http/HttpSuccess.java new file mode 100644 index 0000000000..57c59ccf1b --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/HttpSuccess.java @@ -0,0 +1,1156 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpSuccess. + */ +public interface HttpSuccess { + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head200(); + + /** + * Return 200 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head200Async(final ServiceCallback serviceCallback); + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable head200Async(); + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> head200WithServiceResponseAsync(); + + /** + * Get 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + boolean get200(); + + /** + * Get 200 success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Async(final ServiceCallback serviceCallback); + + /** + * Get 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable get200Async(); + + /** + * Get 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the boolean object + */ + Observable> get200WithServiceResponseAsync(); + + /** + * Put boolean value true returning 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put200(); + + /** + * Put boolean value true returning 200 success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200Async(final ServiceCallback serviceCallback); + + /** + * Put boolean value true returning 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put200Async(); + + /** + * Put boolean value true returning 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put200WithServiceResponseAsync(); + /** + * Put boolean value true returning 200 success. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put200(Boolean booleanValue); + + /** + * Put boolean value true returning 200 success. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put200Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Put boolean value true returning 200 success. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put200Async(Boolean booleanValue); + + /** + * Put boolean value true returning 200 success. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put200WithServiceResponseAsync(Boolean booleanValue); + + /** + * Patch true Boolean value in request returning 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch200(); + + /** + * Patch true Boolean value in request returning 200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch200Async(final ServiceCallback serviceCallback); + + /** + * Patch true Boolean value in request returning 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch200Async(); + + /** + * Patch true Boolean value in request returning 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch200WithServiceResponseAsync(); + /** + * Patch true Boolean value in request returning 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch200(Boolean booleanValue); + + /** + * Patch true Boolean value in request returning 200. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch200Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Patch true Boolean value in request returning 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch200Async(Boolean booleanValue); + + /** + * Patch true Boolean value in request returning 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch200WithServiceResponseAsync(Boolean booleanValue); + + /** + * Post bollean value true in request that returns a 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post200(); + + /** + * Post bollean value true in request that returns a 200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post200Async(final ServiceCallback serviceCallback); + + /** + * Post bollean value true in request that returns a 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post200Async(); + + /** + * Post bollean value true in request that returns a 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post200WithServiceResponseAsync(); + /** + * Post bollean value true in request that returns a 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post200(Boolean booleanValue); + + /** + * Post bollean value true in request that returns a 200. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post200Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Post bollean value true in request that returns a 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post200Async(Boolean booleanValue); + + /** + * Post bollean value true in request that returns a 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post200WithServiceResponseAsync(Boolean booleanValue); + + /** + * Delete simple boolean value true returns 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete200(); + + /** + * Delete simple boolean value true returns 200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete200Async(final ServiceCallback serviceCallback); + + /** + * Delete simple boolean value true returns 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete200Async(); + + /** + * Delete simple boolean value true returns 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete200WithServiceResponseAsync(); + /** + * Delete simple boolean value true returns 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete200(Boolean booleanValue); + + /** + * Delete simple boolean value true returns 200. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete200Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Delete simple boolean value true returns 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete200Async(Boolean booleanValue); + + /** + * Delete simple boolean value true returns 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete200WithServiceResponseAsync(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 201. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put201(); + + /** + * Put true Boolean value in request returns 201. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201Async(final ServiceCallback serviceCallback); + + /** + * Put true Boolean value in request returns 201. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put201Async(); + + /** + * Put true Boolean value in request returns 201. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put201WithServiceResponseAsync(); + /** + * Put true Boolean value in request returns 201. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put201(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 201. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put201Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Put true Boolean value in request returns 201. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put201Async(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 201. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put201WithServiceResponseAsync(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post201(); + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post201Async(final ServiceCallback serviceCallback); + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post201Async(); + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post201WithServiceResponseAsync(); + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post201(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post201Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post201Async(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post201WithServiceResponseAsync(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put202(); + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put202Async(final ServiceCallback serviceCallback); + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put202Async(); + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put202WithServiceResponseAsync(); + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put202(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put202Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put202Async(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put202WithServiceResponseAsync(Boolean booleanValue); + + /** + * Patch true Boolean value in request returns 202. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch202(); + + /** + * Patch true Boolean value in request returns 202. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch202Async(final ServiceCallback serviceCallback); + + /** + * Patch true Boolean value in request returns 202. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch202Async(); + + /** + * Patch true Boolean value in request returns 202. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch202WithServiceResponseAsync(); + /** + * Patch true Boolean value in request returns 202. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch202(Boolean booleanValue); + + /** + * Patch true Boolean value in request returns 202. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch202Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Patch true Boolean value in request returns 202. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch202Async(Boolean booleanValue); + + /** + * Patch true Boolean value in request returns 202. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch202WithServiceResponseAsync(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202(); + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202Async(final ServiceCallback serviceCallback); + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post202Async(); + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post202WithServiceResponseAsync(); + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post202(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post202Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post202Async(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post202WithServiceResponseAsync(Boolean booleanValue); + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete202(); + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete202Async(final ServiceCallback serviceCallback); + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete202Async(); + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete202WithServiceResponseAsync(); + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete202(Boolean booleanValue); + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete202Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete202Async(Boolean booleanValue); + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete202WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head204(); + + /** + * Return 204 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head204Async(final ServiceCallback serviceCallback); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable head204Async(); + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> head204WithServiceResponseAsync(); + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put204(); + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put204Async(final ServiceCallback serviceCallback); + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put204Async(); + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put204WithServiceResponseAsync(); + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void put204(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture put204Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable put204Async(Boolean booleanValue); + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> put204WithServiceResponseAsync(Boolean booleanValue); + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch204(); + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch204Async(final ServiceCallback serviceCallback); + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch204Async(); + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch204WithServiceResponseAsync(); + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void patch204(Boolean booleanValue); + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture patch204Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable patch204Async(Boolean booleanValue); + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> patch204WithServiceResponseAsync(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post204(); + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post204Async(final ServiceCallback serviceCallback); + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post204Async(); + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post204WithServiceResponseAsync(); + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void post204(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture post204Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable post204Async(Boolean booleanValue); + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> post204WithServiceResponseAsync(Boolean booleanValue); + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete204(); + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete204Async(final ServiceCallback serviceCallback); + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete204Async(); + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete204WithServiceResponseAsync(); + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void delete204(Boolean booleanValue); + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture delete204Async(Boolean booleanValue, final ServiceCallback serviceCallback); + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable delete204Async(Boolean booleanValue); + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> delete204WithServiceResponseAsync(Boolean booleanValue); + + /** + * Return 404 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void head404(); + + /** + * Return 404 status code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture head404Async(final ServiceCallback serviceCallback); + + /** + * Return 404 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable head404Async(); + + /** + * Return 404 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> head404WithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/http/MultipleResponses.java b/test/vanilla/src/main/java/fixtures/http/MultipleResponses.java new file mode 100644 index 0000000000..f40fd95f42 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/MultipleResponses.java @@ -0,0 +1,1207 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http; + +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.A; +import fixtures.http.models.ErrorException; +import fixtures.http.models.MyException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MultipleResponses. + */ +public interface MultipleResponses { + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200Model204NoModelDefaultError200Valid(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Model204NoModelDefaultError200ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200Model204NoModelDefaultError200ValidAsync(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200Model204NoModelDefaultError200ValidWithServiceResponseAsync(); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200Model204NoModelDefaultError204Valid(); + + /** + * Send a 204 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Model204NoModelDefaultError204ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200Model204NoModelDefaultError204ValidAsync(); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200Model204NoModelDefaultError204ValidWithServiceResponseAsync(); + + /** + * Send a 201 response with valid payload: {'statusCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200Model204NoModelDefaultError201Invalid(); + + /** + * Send a 201 response with valid payload: {'statusCode': '201'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Model204NoModelDefaultError201InvalidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 201 response with valid payload: {'statusCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200Model204NoModelDefaultError201InvalidAsync(); + + /** + * Send a 201 response with valid payload: {'statusCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200Model204NoModelDefaultError201InvalidWithServiceResponseAsync(); + + /** + * Send a 202 response with no payload:. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200Model204NoModelDefaultError202None(); + + /** + * Send a 202 response with no payload:. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Model204NoModelDefaultError202NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 202 response with no payload:. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200Model204NoModelDefaultError202NoneAsync(); + + /** + * Send a 202 response with no payload:. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200Model204NoModelDefaultError202NoneWithServiceResponseAsync(); + + /** + * Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200Model204NoModelDefaultError400Valid(); + + /** + * Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Model204NoModelDefaultError400ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200Model204NoModelDefaultError400ValidAsync(); + + /** + * Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200Model204NoModelDefaultError400ValidWithServiceResponseAsync(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200Model201ModelDefaultError200Valid(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Model201ModelDefaultError200ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200Model201ModelDefaultError200ValidAsync(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200Model201ModelDefaultError200ValidWithServiceResponseAsync(); + + /** + * Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200Model201ModelDefaultError201Valid(); + + /** + * Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Model201ModelDefaultError201ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200Model201ModelDefaultError201ValidAsync(); + + /** + * Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200Model201ModelDefaultError201ValidWithServiceResponseAsync(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200Model201ModelDefaultError400Valid(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200Model201ModelDefaultError400ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200Model201ModelDefaultError400ValidAsync(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200Model201ModelDefaultError400ValidWithServiceResponseAsync(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + Object get200ModelA201ModelC404ModelDDefaultError200Valid(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA201ModelC404ModelDDefaultError200ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable get200ModelA201ModelC404ModelDDefaultError200ValidAsync(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> get200ModelA201ModelC404ModelDDefaultError200ValidWithServiceResponseAsync(); + + /** + * Send a 200 response with valid payload: {'httpCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + Object get200ModelA201ModelC404ModelDDefaultError201Valid(); + + /** + * Send a 200 response with valid payload: {'httpCode': '201'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA201ModelC404ModelDDefaultError201ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with valid payload: {'httpCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable get200ModelA201ModelC404ModelDDefaultError201ValidAsync(); + + /** + * Send a 200 response with valid payload: {'httpCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> get200ModelA201ModelC404ModelDDefaultError201ValidWithServiceResponseAsync(); + + /** + * Send a 200 response with valid payload: {'httpStatusCode': '404'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + Object get200ModelA201ModelC404ModelDDefaultError404Valid(); + + /** + * Send a 200 response with valid payload: {'httpStatusCode': '404'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA201ModelC404ModelDDefaultError404ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with valid payload: {'httpStatusCode': '404'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable get200ModelA201ModelC404ModelDDefaultError404ValidAsync(); + + /** + * Send a 200 response with valid payload: {'httpStatusCode': '404'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> get200ModelA201ModelC404ModelDDefaultError404ValidWithServiceResponseAsync(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + Object get200ModelA201ModelC404ModelDDefaultError400Valid(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA201ModelC404ModelDDefaultError400ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable get200ModelA201ModelC404ModelDDefaultError400ValidAsync(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + Observable> get200ModelA201ModelC404ModelDDefaultError400ValidWithServiceResponseAsync(); + + /** + * Send a 202 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get202None204NoneDefaultError202None(); + + /** + * Send a 202 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get202None204NoneDefaultError202NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 202 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable get202None204NoneDefaultError202NoneAsync(); + + /** + * Send a 202 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> get202None204NoneDefaultError202NoneWithServiceResponseAsync(); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get202None204NoneDefaultError204None(); + + /** + * Send a 204 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get202None204NoneDefaultError204NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable get202None204NoneDefaultError204NoneAsync(); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> get202None204NoneDefaultError204NoneWithServiceResponseAsync(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get202None204NoneDefaultError400Valid(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get202None204NoneDefaultError400ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable get202None204NoneDefaultError400ValidAsync(); + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> get202None204NoneDefaultError400ValidWithServiceResponseAsync(); + + /** + * Send a 202 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get202None204NoneDefaultNone202Invalid(); + + /** + * Send a 202 response with an unexpected payload {'property': 'value'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get202None204NoneDefaultNone202InvalidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 202 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable get202None204NoneDefaultNone202InvalidAsync(); + + /** + * Send a 202 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> get202None204NoneDefaultNone202InvalidWithServiceResponseAsync(); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get202None204NoneDefaultNone204None(); + + /** + * Send a 204 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get202None204NoneDefaultNone204NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable get202None204NoneDefaultNone204NoneAsync(); + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> get202None204NoneDefaultNone204NoneWithServiceResponseAsync(); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get202None204NoneDefaultNone400None(); + + /** + * Send a 400 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get202None204NoneDefaultNone400NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable get202None204NoneDefaultNone400NoneAsync(); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> get202None204NoneDefaultNone400NoneWithServiceResponseAsync(); + + /** + * Send a 400 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void get202None204NoneDefaultNone400Invalid(); + + /** + * Send a 400 response with an unexpected payload {'property': 'value'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get202None204NoneDefaultNone400InvalidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable get202None204NoneDefaultNone400InvalidAsync(); + + /** + * Send a 400 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> get202None204NoneDefaultNone400InvalidWithServiceResponseAsync(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws MyException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A getDefaultModelA200Valid(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDefaultModelA200ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable getDefaultModelA200ValidAsync(); + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> getDefaultModelA200ValidWithServiceResponseAsync(); + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws MyException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A getDefaultModelA200None(); + + /** + * Send a 200 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDefaultModelA200NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable getDefaultModelA200NoneAsync(); + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> getDefaultModelA200NoneWithServiceResponseAsync(); + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws MyException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A getDefaultModelA400Valid(); + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDefaultModelA400ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable getDefaultModelA400ValidAsync(); + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> getDefaultModelA400ValidWithServiceResponseAsync(); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws MyException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A getDefaultModelA400None(); + + /** + * Send a 400 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDefaultModelA400NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable getDefaultModelA400NoneAsync(); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> getDefaultModelA400NoneWithServiceResponseAsync(); + + /** + * Send a 200 response with invalid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getDefaultNone200Invalid(); + + /** + * Send a 200 response with invalid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDefaultNone200InvalidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with invalid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getDefaultNone200InvalidAsync(); + + /** + * Send a 200 response with invalid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getDefaultNone200InvalidWithServiceResponseAsync(); + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getDefaultNone200None(); + + /** + * Send a 200 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDefaultNone200NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getDefaultNone200NoneAsync(); + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getDefaultNone200NoneWithServiceResponseAsync(); + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getDefaultNone400Invalid(); + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDefaultNone400InvalidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getDefaultNone400InvalidAsync(); + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getDefaultNone400InvalidWithServiceResponseAsync(); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getDefaultNone400None(); + + /** + * Send a 400 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getDefaultNone400NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getDefaultNone400NoneAsync(); + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getDefaultNone400NoneWithServiceResponseAsync(); + + /** + * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200ModelA200None(); + + /** + * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA200NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200ModelA200NoneAsync(); + + /** + * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200ModelA200NoneWithServiceResponseAsync(); + + /** + * Send a 200 response with payload {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200ModelA200Valid(); + + /** + * Send a 200 response with payload {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA200ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with payload {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200ModelA200ValidAsync(); + + /** + * Send a 200 response with payload {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200ModelA200ValidWithServiceResponseAsync(); + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200ModelA200Invalid(); + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA200InvalidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200ModelA200InvalidAsync(); + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200ModelA200InvalidWithServiceResponseAsync(); + + /** + * Send a 400 response with no payload client should treat as an http error with no error model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200ModelA400None(); + + /** + * Send a 400 response with no payload client should treat as an http error with no error model. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA400NoneAsync(final ServiceCallback serviceCallback); + + /** + * Send a 400 response with no payload client should treat as an http error with no error model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200ModelA400NoneAsync(); + + /** + * Send a 400 response with no payload client should treat as an http error with no error model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200ModelA400NoneWithServiceResponseAsync(); + + /** + * Send a 200 response with payload {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200ModelA400Valid(); + + /** + * Send a 200 response with payload {'statusCode': '400'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA400ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with payload {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200ModelA400ValidAsync(); + + /** + * Send a 200 response with payload {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200ModelA400ValidWithServiceResponseAsync(); + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200ModelA400Invalid(); + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA400InvalidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200ModelA400InvalidAsync(); + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200ModelA400InvalidWithServiceResponseAsync(); + + /** + * Send a 202 response with payload {'statusCode': '202'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + A get200ModelA202Valid(); + + /** + * Send a 202 response with payload {'statusCode': '202'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture get200ModelA202ValidAsync(final ServiceCallback serviceCallback); + + /** + * Send a 202 response with payload {'statusCode': '202'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable get200ModelA202ValidAsync(); + + /** + * Send a 202 response with payload {'statusCode': '202'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + Observable> get200ModelA202ValidWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/AutoRestHttpInfrastructureTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/http/implementation/AutoRestHttpInfrastructureTestServiceImpl.java new file mode 100644 index 0000000000..30af8c85b6 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/AutoRestHttpInfrastructureTestServiceImpl.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.implementation; + +import fixtures.http.AutoRestHttpInfrastructureTestService; +import fixtures.http.HttpFailures; +import fixtures.http.HttpSuccess; +import fixtures.http.HttpRedirects; +import fixtures.http.HttpClientFailures; +import fixtures.http.HttpServerFailures; +import fixtures.http.HttpRetrys; +import fixtures.http.MultipleResponses; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestHttpInfrastructureTestService class. + */ +public class AutoRestHttpInfrastructureTestServiceImpl extends ServiceClient implements AutoRestHttpInfrastructureTestService { + + /** + * The HttpFailures object to access its operations. + */ + private HttpFailures httpFailures; + + /** + * Gets the HttpFailures object to access its operations. + * @return the HttpFailures object. + */ + public HttpFailures httpFailures() { + return this.httpFailures; + } + + /** + * The HttpSuccess object to access its operations. + */ + private HttpSuccess httpSuccess; + + /** + * Gets the HttpSuccess object to access its operations. + * @return the HttpSuccess object. + */ + public HttpSuccess httpSuccess() { + return this.httpSuccess; + } + + /** + * The HttpRedirects object to access its operations. + */ + private HttpRedirects httpRedirects; + + /** + * Gets the HttpRedirects object to access its operations. + * @return the HttpRedirects object. + */ + public HttpRedirects httpRedirects() { + return this.httpRedirects; + } + + /** + * The HttpClientFailures object to access its operations. + */ + private HttpClientFailures httpClientFailures; + + /** + * Gets the HttpClientFailures object to access its operations. + * @return the HttpClientFailures object. + */ + public HttpClientFailures httpClientFailures() { + return this.httpClientFailures; + } + + /** + * The HttpServerFailures object to access its operations. + */ + private HttpServerFailures httpServerFailures; + + /** + * Gets the HttpServerFailures object to access its operations. + * @return the HttpServerFailures object. + */ + public HttpServerFailures httpServerFailures() { + return this.httpServerFailures; + } + + /** + * The HttpRetrys object to access its operations. + */ + private HttpRetrys httpRetrys; + + /** + * Gets the HttpRetrys object to access its operations. + * @return the HttpRetrys object. + */ + public HttpRetrys httpRetrys() { + return this.httpRetrys; + } + + /** + * The MultipleResponses object to access its operations. + */ + private MultipleResponses multipleResponses; + + /** + * Gets the MultipleResponses object to access its operations. + * @return the MultipleResponses object. + */ + public MultipleResponses multipleResponses() { + return this.multipleResponses; + } + + /** + * Initializes an instance of AutoRestHttpInfrastructureTestService client. + */ + public AutoRestHttpInfrastructureTestServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestHttpInfrastructureTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestHttpInfrastructureTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestHttpInfrastructureTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestHttpInfrastructureTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestHttpInfrastructureTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestHttpInfrastructureTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestHttpInfrastructureTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestHttpInfrastructureTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.httpFailures = new HttpFailuresImpl(retrofit(), this); + this.httpSuccess = new HttpSuccessImpl(retrofit(), this); + this.httpRedirects = new HttpRedirectsImpl(retrofit(), this); + this.httpClientFailures = new HttpClientFailuresImpl(retrofit(), this); + this.httpServerFailures = new HttpServerFailuresImpl(retrofit(), this); + this.httpRetrys = new HttpRetrysImpl(retrofit(), this); + this.multipleResponses = new MultipleResponsesImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/HttpClientFailuresImpl.java b/test/vanilla/src/main/java/fixtures/http/implementation/HttpClientFailuresImpl.java new file mode 100644 index 0000000000..464f7ef9f5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/HttpClientFailuresImpl.java @@ -0,0 +1,2481 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.implementation; + +import retrofit2.Retrofit; +import fixtures.http.HttpClientFailures; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.Error; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.HEAD; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpClientFailures. + */ +public class HttpClientFailuresImpl implements HttpClientFailures { + /** The Retrofit service to perform REST calls. */ + private HttpClientFailuresService service; + /** The service client containing this operation class. */ + private AutoRestHttpInfrastructureTestServiceImpl client; + + /** + * Initializes an instance of HttpClientFailures. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HttpClientFailuresImpl(Retrofit retrofit, AutoRestHttpInfrastructureTestServiceImpl client) { + this.service = retrofit.create(HttpClientFailuresService.class); + this.client = client; + } + + /** + * The interface defining all the services for HttpClientFailures to be + * used by Retrofit to perform actually REST calls. + */ + interface HttpClientFailuresService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures head400" }) + @HEAD("http/failure/client/400") + Observable> head400(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures get400" }) + @GET("http/failure/client/400") + Observable> get400(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures put400" }) + @PUT("http/failure/client/400") + Observable> put400(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures patch400" }) + @PATCH("http/failure/client/400") + Observable> patch400(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures post400" }) + @POST("http/failure/client/400") + Observable> post400(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures delete400" }) + @HTTP(path = "http/failure/client/400", method = "DELETE", hasBody = true) + Observable> delete400(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures head401" }) + @HEAD("http/failure/client/401") + Observable> head401(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures get402" }) + @GET("http/failure/client/402") + Observable> get402(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures get403" }) + @GET("http/failure/client/403") + Observable> get403(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures put404" }) + @PUT("http/failure/client/404") + Observable> put404(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures patch405" }) + @PATCH("http/failure/client/405") + Observable> patch405(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures post406" }) + @POST("http/failure/client/406") + Observable> post406(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures delete407" }) + @HTTP(path = "http/failure/client/407", method = "DELETE", hasBody = true) + Observable> delete407(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures put409" }) + @PUT("http/failure/client/409") + Observable> put409(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures head410" }) + @HEAD("http/failure/client/410") + Observable> head410(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures get411" }) + @GET("http/failure/client/411") + Observable> get411(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures get412" }) + @GET("http/failure/client/412") + Observable> get412(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures put413" }) + @PUT("http/failure/client/413") + Observable> put413(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures patch414" }) + @PATCH("http/failure/client/414") + Observable> patch414(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures post415" }) + @POST("http/failure/client/415") + Observable> post415(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures get416" }) + @GET("http/failure/client/416") + Observable> get416(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures delete417" }) + @HTTP(path = "http/failure/client/417", method = "DELETE", hasBody = true) + Observable> delete417(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpClientFailures head429" }) + @HEAD("http/failure/client/429") + Observable> head429(); + + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error head400() { + return head400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable head400Async() { + return head400WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> head400WithServiceResponseAsync() { + return service.head400() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head400Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error get400() { + return get400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable get400Async() { + return get400WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> get400WithServiceResponseAsync() { + return service.get400() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get400Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error put400() { + return put400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable put400Async() { + return put400WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> put400WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put400(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error put400(Boolean booleanValue) { + return put400WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put400Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put400WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable put400Async(Boolean booleanValue) { + return put400WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> put400WithServiceResponseAsync(Boolean booleanValue) { + return service.put400(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put400Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error patch400() { + return patch400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable patch400Async() { + return patch400WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> patch400WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch400(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error patch400(Boolean booleanValue) { + return patch400WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch400Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch400WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable patch400Async(Boolean booleanValue) { + return patch400WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> patch400WithServiceResponseAsync(Boolean booleanValue) { + return service.patch400(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patch400Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error post400() { + return post400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable post400Async() { + return post400WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> post400WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post400(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error post400(Boolean booleanValue) { + return post400WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post400Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post400WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable post400Async(Boolean booleanValue) { + return post400WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> post400WithServiceResponseAsync(Boolean booleanValue) { + return service.post400(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post400Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error delete400() { + return delete400WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete400Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete400WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable delete400Async() { + return delete400WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> delete400WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete400(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error delete400(Boolean booleanValue) { + return delete400WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete400Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete400WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable delete400Async(Boolean booleanValue) { + return delete400WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 400 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> delete400WithServiceResponseAsync(Boolean booleanValue) { + return service.delete400(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete400Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse delete400Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 401 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error head401() { + return head401WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 401 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head401Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head401WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 401 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable head401Async() { + return head401WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 401 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> head401WithServiceResponseAsync() { + return service.head401() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head401Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head401Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + + /** + * Return 402 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error get402() { + return get402WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 402 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get402Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get402WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 402 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable get402Async() { + return get402WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 402 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> get402WithServiceResponseAsync() { + return service.get402() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get402Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get402Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 403 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error get403() { + return get403WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 403 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get403Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get403WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 403 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable get403Async() { + return get403WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 403 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> get403WithServiceResponseAsync() { + return service.get403() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get403Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get403Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error put404() { + return put404WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put404Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put404WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable put404Async() { + return put404WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> put404WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put404(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put404Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error put404(Boolean booleanValue) { + return put404WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put404Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put404WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable put404Async(Boolean booleanValue) { + return put404WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 404 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> put404WithServiceResponseAsync(Boolean booleanValue) { + return service.put404(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put404Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put404Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error patch405() { + return patch405WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch405Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch405WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable patch405Async() { + return patch405WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> patch405WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch405(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch405Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error patch405(Boolean booleanValue) { + return patch405WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch405Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch405WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable patch405Async(Boolean booleanValue) { + return patch405WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 405 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> patch405WithServiceResponseAsync(Boolean booleanValue) { + return service.patch405(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch405Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patch405Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error post406() { + return post406WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post406Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post406WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable post406Async() { + return post406WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> post406WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post406(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post406Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error post406(Boolean booleanValue) { + return post406WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post406Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post406WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable post406Async(Boolean booleanValue) { + return post406WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 406 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> post406WithServiceResponseAsync(Boolean booleanValue) { + return service.post406(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post406Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post406Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error delete407() { + return delete407WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete407Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete407WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable delete407Async() { + return delete407WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> delete407WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete407(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete407Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error delete407(Boolean booleanValue) { + return delete407WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete407Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete407WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable delete407Async(Boolean booleanValue) { + return delete407WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 407 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> delete407WithServiceResponseAsync(Boolean booleanValue) { + return service.delete407(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete407Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse delete407Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error put409() { + return put409WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put409Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put409WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable put409Async() { + return put409WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> put409WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put409(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put409Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error put409(Boolean booleanValue) { + return put409WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put409Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put409WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable put409Async(Boolean booleanValue) { + return put409WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 409 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> put409WithServiceResponseAsync(Boolean booleanValue) { + return service.put409(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put409Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put409Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 410 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error head410() { + return head410WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 410 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head410Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head410WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 410 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable head410Async() { + return head410WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 410 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> head410WithServiceResponseAsync() { + return service.head410() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head410Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head410Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + + /** + * Return 411 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error get411() { + return get411WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 411 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get411Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get411WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 411 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable get411Async() { + return get411WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 411 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> get411WithServiceResponseAsync() { + return service.get411() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get411Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get411Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 412 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error get412() { + return get412WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 412 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get412Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get412WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 412 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable get412Async() { + return get412WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 412 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> get412WithServiceResponseAsync() { + return service.get412() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get412Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get412Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error put413() { + return put413WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put413Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put413WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable put413Async() { + return put413WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> put413WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put413(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put413Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error put413(Boolean booleanValue) { + return put413WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put413Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put413WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable put413Async(Boolean booleanValue) { + return put413WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 413 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> put413WithServiceResponseAsync(Boolean booleanValue) { + return service.put413(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put413Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put413Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error patch414() { + return patch414WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch414Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch414WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable patch414Async() { + return patch414WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> patch414WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch414(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch414Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error patch414(Boolean booleanValue) { + return patch414WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch414Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch414WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable patch414Async(Boolean booleanValue) { + return patch414WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 414 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> patch414WithServiceResponseAsync(Boolean booleanValue) { + return service.patch414(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch414Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patch414Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error post415() { + return post415WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post415Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post415WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable post415Async() { + return post415WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> post415WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post415(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post415Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error post415(Boolean booleanValue) { + return post415WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post415Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post415WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable post415Async(Boolean booleanValue) { + return post415WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 415 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> post415WithServiceResponseAsync(Boolean booleanValue) { + return service.post415(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post415Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post415Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 416 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error get416() { + return get416WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 416 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get416Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get416WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 416 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable get416Async() { + return get416WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 416 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> get416WithServiceResponseAsync() { + return service.get416() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get416Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get416Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error delete417() { + return delete417WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete417Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete417WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable delete417Async() { + return delete417WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> delete417WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete417(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete417Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error delete417(Boolean booleanValue) { + return delete417WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete417Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete417WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable delete417Async(Boolean booleanValue) { + return delete417WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 417 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> delete417WithServiceResponseAsync(Boolean booleanValue) { + return service.delete417(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete417Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse delete417Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 429 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error head429() { + return head429WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 429 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head429Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head429WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 429 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable head429Async() { + return head429WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 429 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> head429WithServiceResponseAsync() { + return service.head429() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head429Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head429Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/HttpFailuresImpl.java b/test/vanilla/src/main/java/fixtures/http/implementation/HttpFailuresImpl.java new file mode 100644 index 0000000000..c31c435faa --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/HttpFailuresImpl.java @@ -0,0 +1,265 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.implementation; + +import retrofit2.Retrofit; +import fixtures.http.HttpFailures; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpFailures. + */ +public class HttpFailuresImpl implements HttpFailures { + /** The Retrofit service to perform REST calls. */ + private HttpFailuresService service; + /** The service client containing this operation class. */ + private AutoRestHttpInfrastructureTestServiceImpl client; + + /** + * Initializes an instance of HttpFailures. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HttpFailuresImpl(Retrofit retrofit, AutoRestHttpInfrastructureTestServiceImpl client) { + this.service = retrofit.create(HttpFailuresService.class); + this.client = client; + } + + /** + * The interface defining all the services for HttpFailures to be + * used by Retrofit to perform actually REST calls. + */ + interface HttpFailuresService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpFailures getEmptyError" }) + @GET("http/failure/emptybody/error") + Observable> getEmptyError(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpFailures getNoModelError" }) + @GET("http/failure/nomodel/error") + Observable> getNoModelError(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpFailures getNoModelEmpty" }) + @GET("http/failure/nomodel/empty") + Observable> getNoModelEmpty(); + + } + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean getEmptyError() { + return getEmptyErrorWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty error form server. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getEmptyErrorAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getEmptyErrorWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable getEmptyErrorAsync() { + return getEmptyErrorWithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> getEmptyErrorWithServiceResponseAsync() { + return service.getEmptyError() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getEmptyErrorDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getEmptyErrorDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean getNoModelError() { + return getNoModelErrorWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty error form server. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNoModelErrorAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNoModelErrorWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable getNoModelErrorAsync() { + return getNoModelErrorWithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get empty error form server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> getNoModelErrorWithServiceResponseAsync() { + return service.getNoModelError() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNoModelErrorDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNoModelErrorDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Get empty response from server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean getNoModelEmpty() { + return getNoModelEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get empty response from server. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNoModelEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNoModelEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get empty response from server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable getNoModelEmptyAsync() { + return getNoModelEmptyWithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get empty response from server. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> getNoModelEmptyWithServiceResponseAsync() { + return service.getNoModelEmpty() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNoModelEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNoModelEmptyDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/HttpRedirectsImpl.java b/test/vanilla/src/main/java/fixtures/http/implementation/HttpRedirectsImpl.java new file mode 100644 index 0000000000..f5898ac9cf --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/HttpRedirectsImpl.java @@ -0,0 +1,1568 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.implementation; + +import retrofit2.Retrofit; +import fixtures.http.HttpRedirects; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponseWithHeaders; +import fixtures.http.models.ErrorException; +import fixtures.http.models.HttpRedirectsDelete307Headers; +import fixtures.http.models.HttpRedirectsGet300Headers; +import fixtures.http.models.HttpRedirectsGet301Headers; +import fixtures.http.models.HttpRedirectsGet302Headers; +import fixtures.http.models.HttpRedirectsGet307Headers; +import fixtures.http.models.HttpRedirectsHead300Headers; +import fixtures.http.models.HttpRedirectsHead301Headers; +import fixtures.http.models.HttpRedirectsHead302Headers; +import fixtures.http.models.HttpRedirectsHead307Headers; +import fixtures.http.models.HttpRedirectsPatch302Headers; +import fixtures.http.models.HttpRedirectsPatch307Headers; +import fixtures.http.models.HttpRedirectsPost303Headers; +import fixtures.http.models.HttpRedirectsPost307Headers; +import fixtures.http.models.HttpRedirectsPut301Headers; +import fixtures.http.models.HttpRedirectsPut307Headers; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.HEAD; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpRedirects. + */ +public class HttpRedirectsImpl implements HttpRedirects { + /** The Retrofit service to perform REST calls. */ + private HttpRedirectsService service; + /** The service client containing this operation class. */ + private AutoRestHttpInfrastructureTestServiceImpl client; + + /** + * Initializes an instance of HttpRedirects. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HttpRedirectsImpl(Retrofit retrofit, AutoRestHttpInfrastructureTestServiceImpl client) { + this.service = retrofit.create(HttpRedirectsService.class); + this.client = client; + } + + /** + * The interface defining all the services for HttpRedirects to be + * used by Retrofit to perform actually REST calls. + */ + interface HttpRedirectsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects head300" }) + @HEAD("http/redirect/300") + Observable> head300(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects get300" }) + @GET("http/redirect/300") + Observable> get300(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects head301" }) + @HEAD("http/redirect/301") + Observable> head301(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects get301" }) + @GET("http/redirect/301") + Observable> get301(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects put301" }) + @PUT("http/redirect/301") + Observable> put301(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects head302" }) + @HEAD("http/redirect/302") + Observable> head302(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects get302" }) + @GET("http/redirect/302") + Observable> get302(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects patch302" }) + @PATCH("http/redirect/302") + Observable> patch302(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects post303" }) + @POST("http/redirect/303") + Observable> post303(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects head307" }) + @HEAD("http/redirect/307") + Observable> head307(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects get307" }) + @GET("http/redirect/307") + Observable> get307(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects put307" }) + @PUT("http/redirect/307") + Observable> put307(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects patch307" }) + @PATCH("http/redirect/307") + Observable> patch307(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects post307" }) + @POST("http/redirect/307") + Observable> post307(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRedirects delete307" }) + @HTTP(path = "http/redirect/307", method = "DELETE", hasBody = true) + Observable> delete307(@Body Boolean booleanValue); + + } + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head300() { + head300WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head300Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(head300WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable head300Async() { + return head300WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> head300WithServiceResponseAsync() { + return service.head300() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = head300Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders head300Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(300, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmptyWithHeaders(response, HttpRedirectsHead300Headers.class); + } + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<String> object if successful. + */ + public List get300() { + return get300WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> get300Async(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromHeaderResponse(get300WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable> get300Async() { + return get300WithServiceResponseAsync().map(new Func1, HttpRedirectsGet300Headers>, List>() { + @Override + public List call(ServiceResponseWithHeaders, HttpRedirectsGet300Headers> response) { + return response.body(); + } + }); + } + + /** + * Return 300 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<String> object + */ + public Observable, HttpRedirectsGet300Headers>> get300WithServiceResponseAsync() { + return service.get300() + .flatMap(new Func1, Observable, HttpRedirectsGet300Headers>>>() { + @Override + public Observable, HttpRedirectsGet300Headers>> call(Response response) { + try { + ServiceResponseWithHeaders, HttpRedirectsGet300Headers> clientResponse = get300Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders, HttpRedirectsGet300Headers> get300Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(300, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsGet300Headers.class); + } + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head301() { + head301WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head301Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(head301WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable head301Async() { + return head301WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> head301WithServiceResponseAsync() { + return service.head301() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = head301Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders head301Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(301, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmptyWithHeaders(response, HttpRedirectsHead301Headers.class); + } + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get301() { + get301WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get301Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(get301WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable get301Async() { + return get301WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Return 301 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> get301WithServiceResponseAsync() { + return service.get301() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = get301Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders get301Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(301, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsGet301Headers.class); + } + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put301() { + put301WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put301Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(put301WithServiceResponseAsync(), serviceCallback); + } + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable put301Async() { + return put301WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> put301WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put301(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = put301Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put301(Boolean booleanValue) { + put301WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put301Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(put301WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable put301Async(Boolean booleanValue) { + return put301WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Put true Boolean value in request returns 301. This request should not be automatically redirected, but should return the received 301 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> put301WithServiceResponseAsync(Boolean booleanValue) { + return service.put301(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = put301Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders put301Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(301, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsPut301Headers.class); + } + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head302() { + head302WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head302Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(head302WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable head302Async() { + return head302WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> head302WithServiceResponseAsync() { + return service.head302() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = head302Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders head302Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(302, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmptyWithHeaders(response, HttpRedirectsHead302Headers.class); + } + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get302() { + get302WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get302Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(get302WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable get302Async() { + return get302WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Return 302 status code and redirect to /http/success/200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> get302WithServiceResponseAsync() { + return service.get302() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = get302Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders get302Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(302, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsGet302Headers.class); + } + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch302() { + patch302WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch302Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(patch302WithServiceResponseAsync(), serviceCallback); + } + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable patch302Async() { + return patch302WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> patch302WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch302(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = patch302Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch302(Boolean booleanValue) { + patch302WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch302Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(patch302WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable patch302Async(Boolean booleanValue) { + return patch302WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch true Boolean value in request returns 302. This request should not be automatically redirected, but should return the received 302 to the caller for evaluation. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> patch302WithServiceResponseAsync(Boolean booleanValue) { + return service.patch302(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = patch302Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders patch302Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(302, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsPatch302Headers.class); + } + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post303() { + post303WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post303Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post303WithServiceResponseAsync(), serviceCallback); + } + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable post303Async() { + return post303WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> post303WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post303(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = post303Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post303(Boolean booleanValue) { + post303WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post303Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post303WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable post303Async(Boolean booleanValue) { + return post303WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post true Boolean value in request returns 303. This request should be automatically redirected usign a get, ultimately returning a 200 status code. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> post303WithServiceResponseAsync(Boolean booleanValue) { + return service.post303(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = post303Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders post303Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(303, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsPost303Headers.class); + } + + /** + * Redirect with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head307() { + head307WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Redirect with 307, resulting in a 200 success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head307Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(head307WithServiceResponseAsync(), serviceCallback); + } + + /** + * Redirect with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable head307Async() { + return head307WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Redirect with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> head307WithServiceResponseAsync() { + return service.head307() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = head307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders head307Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(307, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmptyWithHeaders(response, HttpRedirectsHead307Headers.class); + } + + /** + * Redirect get with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get307() { + get307WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Redirect get with 307, resulting in a 200 success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get307Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(get307WithServiceResponseAsync(), serviceCallback); + } + + /** + * Redirect get with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable get307Async() { + return get307WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Redirect get with 307, resulting in a 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> get307WithServiceResponseAsync() { + return service.get307() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = get307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders get307Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(307, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsGet307Headers.class); + } + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put307() { + put307WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put307Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(put307WithServiceResponseAsync(), serviceCallback); + } + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable put307Async() { + return put307WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> put307WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put307(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = put307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put307(Boolean booleanValue) { + put307WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put307Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(put307WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable put307Async(Boolean booleanValue) { + return put307WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Put redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> put307WithServiceResponseAsync(Boolean booleanValue) { + return service.put307(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = put307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders put307Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(307, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsPut307Headers.class); + } + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch307() { + patch307WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch307Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(patch307WithServiceResponseAsync(), serviceCallback); + } + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable patch307Async() { + return patch307WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> patch307WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch307(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = patch307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch307(Boolean booleanValue) { + patch307WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch307Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(patch307WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable patch307Async(Boolean booleanValue) { + return patch307WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Patch redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> patch307WithServiceResponseAsync(Boolean booleanValue) { + return service.patch307(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = patch307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders patch307Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(307, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsPatch307Headers.class); + } + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post307() { + post307WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post307Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post307WithServiceResponseAsync(), serviceCallback); + } + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable post307Async() { + return post307WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> post307WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post307(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = post307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post307(Boolean booleanValue) { + post307WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post307Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(post307WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable post307Async(Boolean booleanValue) { + return post307WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Post redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> post307WithServiceResponseAsync(Boolean booleanValue) { + return service.post307(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = post307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders post307Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(307, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsPost307Headers.class); + } + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete307() { + delete307WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete307Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete307WithServiceResponseAsync(), serviceCallback); + } + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable delete307Async() { + return delete307WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> delete307WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete307(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = delete307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete307(Boolean booleanValue) { + delete307WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete307Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(delete307WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable delete307Async(Boolean booleanValue) { + return delete307WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Delete redirected with 307, resulting in a 200 after redirect. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponseWithHeaders} object if successful. + */ + public Observable> delete307WithServiceResponseAsync(Boolean booleanValue) { + return service.delete307(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = delete307Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders delete307Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(307, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildWithHeaders(response, HttpRedirectsDelete307Headers.class); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/HttpRetrysImpl.java b/test/vanilla/src/main/java/fixtures/http/implementation/HttpRetrysImpl.java new file mode 100644 index 0000000000..ab02433ae4 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/HttpRetrysImpl.java @@ -0,0 +1,992 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.implementation; + +import retrofit2.Retrofit; +import fixtures.http.HttpRetrys; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.HEAD; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpRetrys. + */ +public class HttpRetrysImpl implements HttpRetrys { + /** The Retrofit service to perform REST calls. */ + private HttpRetrysService service; + /** The service client containing this operation class. */ + private AutoRestHttpInfrastructureTestServiceImpl client; + + /** + * Initializes an instance of HttpRetrys. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HttpRetrysImpl(Retrofit retrofit, AutoRestHttpInfrastructureTestServiceImpl client) { + this.service = retrofit.create(HttpRetrysService.class); + this.client = client; + } + + /** + * The interface defining all the services for HttpRetrys to be + * used by Retrofit to perform actually REST calls. + */ + interface HttpRetrysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys head408" }) + @HEAD("http/retry/408") + Observable> head408(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys put500" }) + @PUT("http/retry/500") + Observable> put500(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys patch500" }) + @PATCH("http/retry/500") + Observable> patch500(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys get502" }) + @GET("http/retry/502") + Observable> get502(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys post503" }) + @POST("http/retry/503") + Observable> post503(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys delete503" }) + @HTTP(path = "http/retry/503", method = "DELETE", hasBody = true) + Observable> delete503(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys put504" }) + @PUT("http/retry/504") + Observable> put504(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpRetrys patch504" }) + @PATCH("http/retry/504") + Observable> patch504(@Body Boolean booleanValue); + + } + + /** + * Return 408 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head408() { + head408WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 408 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head408Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head408WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 408 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head408Async() { + return head408WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 408 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head408WithServiceResponseAsync() { + return service.head408() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head408Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head408Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put500() { + put500WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put500Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put500WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put500Async() { + return put500WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put500WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put500(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put500Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put500(Boolean booleanValue) { + put500WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put500Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put500WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put500Async(Boolean booleanValue) { + return put500WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put500WithServiceResponseAsync(Boolean booleanValue) { + return service.put500(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put500Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put500Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch500() { + patch500WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch500Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch500WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch500Async() { + return patch500WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch500WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch500(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch500Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch500(Boolean booleanValue) { + patch500WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch500Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch500WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch500Async(Boolean booleanValue) { + return patch500WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 500 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch500WithServiceResponseAsync(Boolean booleanValue) { + return service.patch500(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch500Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patch500Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 502 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get502() { + get502WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 502 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get502Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get502WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 502 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable get502Async() { + return get502WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 502 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> get502WithServiceResponseAsync() { + return service.get502() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get502Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get502Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post503() { + post503WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post503Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post503WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post503Async() { + return post503WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post503WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post503(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post503Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post503(Boolean booleanValue) { + post503WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post503Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post503WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post503Async(Boolean booleanValue) { + return post503WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post503WithServiceResponseAsync(Boolean booleanValue) { + return service.post503(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post503Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post503Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete503() { + delete503WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete503Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete503WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable delete503Async() { + return delete503WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> delete503WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete503(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete503Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete503(Boolean booleanValue) { + delete503WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete503Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete503WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable delete503Async(Boolean booleanValue) { + return delete503WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 503 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> delete503WithServiceResponseAsync(Boolean booleanValue) { + return service.delete503(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete503Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse delete503Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put504() { + put504WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put504Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put504WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put504Async() { + return put504WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put504WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put504(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put504Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put504(Boolean booleanValue) { + put504WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put504Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put504WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put504Async(Boolean booleanValue) { + return put504WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put504WithServiceResponseAsync(Boolean booleanValue) { + return service.put504(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put504Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put504Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch504() { + patch504WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch504Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch504WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch504Async() { + return patch504WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch504WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch504(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch504Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch504(Boolean booleanValue) { + patch504WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch504Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch504WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch504Async(Boolean booleanValue) { + return patch504WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 504 status code, then 200 after retry. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch504WithServiceResponseAsync(Boolean booleanValue) { + return service.patch504(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch504Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patch504Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/HttpServerFailuresImpl.java b/test/vanilla/src/main/java/fixtures/http/implementation/HttpServerFailuresImpl.java new file mode 100644 index 0000000000..e1e30a8c8d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/HttpServerFailuresImpl.java @@ -0,0 +1,464 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.implementation; + +import retrofit2.Retrofit; +import fixtures.http.HttpServerFailures; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.Error; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.HEAD; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpServerFailures. + */ +public class HttpServerFailuresImpl implements HttpServerFailures { + /** The Retrofit service to perform REST calls. */ + private HttpServerFailuresService service; + /** The service client containing this operation class. */ + private AutoRestHttpInfrastructureTestServiceImpl client; + + /** + * Initializes an instance of HttpServerFailures. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HttpServerFailuresImpl(Retrofit retrofit, AutoRestHttpInfrastructureTestServiceImpl client) { + this.service = retrofit.create(HttpServerFailuresService.class); + this.client = client; + } + + /** + * The interface defining all the services for HttpServerFailures to be + * used by Retrofit to perform actually REST calls. + */ + interface HttpServerFailuresService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpServerFailures head501" }) + @HEAD("http/failure/server/501") + Observable> head501(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpServerFailures get501" }) + @GET("http/failure/server/501") + Observable> get501(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpServerFailures post505" }) + @POST("http/failure/server/505") + Observable> post505(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpServerFailures delete505" }) + @HTTP(path = "http/failure/server/505", method = "DELETE", hasBody = true) + Observable> delete505(@Body Boolean booleanValue); + + } + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error head501() { + return head501WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head501Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head501WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable head501Async() { + return head501WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> head501WithServiceResponseAsync() { + return service.head501() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head501Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head501Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error get501() { + return get501WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get501Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get501WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable get501Async() { + return get501WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 501 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> get501WithServiceResponseAsync() { + return service.get501() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get501Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get501Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error post505() { + return post505WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post505Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post505WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable post505Async() { + return post505WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> post505WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post505(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post505Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error post505(Boolean booleanValue) { + return post505WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post505Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post505WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable post505Async(Boolean booleanValue) { + return post505WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> post505WithServiceResponseAsync(Boolean booleanValue) { + return service.post505(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post505Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post505Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error delete505() { + return delete505WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete505Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete505WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable delete505Async() { + return delete505WithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> delete505WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete505(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete505Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error delete505(Boolean booleanValue) { + return delete505WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete505Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete505WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable delete505Async(Boolean booleanValue) { + return delete505WithServiceResponseAsync(booleanValue).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 505 status code - should be represented in the client as an error. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> delete505WithServiceResponseAsync(Boolean booleanValue) { + return service.delete505(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete505Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse delete505Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/HttpSuccessImpl.java b/test/vanilla/src/main/java/fixtures/http/implementation/HttpSuccessImpl.java new file mode 100644 index 0000000000..257dedaa4c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/HttpSuccessImpl.java @@ -0,0 +1,2188 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.implementation; + +import retrofit2.Retrofit; +import fixtures.http.HttpSuccess; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.HEAD; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in HttpSuccess. + */ +public class HttpSuccessImpl implements HttpSuccess { + /** The Retrofit service to perform REST calls. */ + private HttpSuccessService service; + /** The service client containing this operation class. */ + private AutoRestHttpInfrastructureTestServiceImpl client; + + /** + * Initializes an instance of HttpSuccess. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public HttpSuccessImpl(Retrofit retrofit, AutoRestHttpInfrastructureTestServiceImpl client) { + this.service = retrofit.create(HttpSuccessService.class); + this.client = client; + } + + /** + * The interface defining all the services for HttpSuccess to be + * used by Retrofit to perform actually REST calls. + */ + interface HttpSuccessService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess head200" }) + @HEAD("http/success/200") + Observable> head200(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess get200" }) + @GET("http/success/200") + Observable> get200(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess put200" }) + @PUT("http/success/200") + Observable> put200(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess patch200" }) + @PATCH("http/success/200") + Observable> patch200(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess post200" }) + @POST("http/success/200") + Observable> post200(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess delete200" }) + @HTTP(path = "http/success/200", method = "DELETE", hasBody = true) + Observable> delete200(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess put201" }) + @PUT("http/success/201") + Observable> put201(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess post201" }) + @POST("http/success/201") + Observable> post201(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess put202" }) + @PUT("http/success/202") + Observable> put202(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess patch202" }) + @PATCH("http/success/202") + Observable> patch202(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess post202" }) + @POST("http/success/202") + Observable> post202(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess delete202" }) + @HTTP(path = "http/success/202", method = "DELETE", hasBody = true) + Observable> delete202(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess head204" }) + @HEAD("http/success/204") + Observable> head204(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess put204" }) + @PUT("http/success/204") + Observable> put204(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess patch204" }) + @PATCH("http/success/204") + Observable> patch204(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess post204" }) + @POST("http/success/204") + Observable> post204(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess delete204" }) + @HTTP(path = "http/success/204", method = "DELETE", hasBody = true) + Observable> delete204(@Body Boolean booleanValue); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.HttpSuccess head404" }) + @HEAD("http/success/404") + Observable> head404(); + + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head200() { + head200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 200 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head200Async() { + return head200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 200 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head200WithServiceResponseAsync() { + return service.head200() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head200Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + + /** + * Get 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the boolean object if successful. + */ + public boolean get200() { + return get200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get 200 success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Get 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable get200Async() { + return get200WithServiceResponseAsync().map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Boolean object + */ + public Observable> get200WithServiceResponseAsync() { + return service.get200() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put boolean value true returning 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put200() { + put200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put boolean value true returning 200 success. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Put boolean value true returning 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put200Async() { + return put200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put boolean value true returning 200 success. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put200WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put200(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put boolean value true returning 200 success. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put200(Boolean booleanValue) { + put200WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Put boolean value true returning 200 success. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put200Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put200WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Put boolean value true returning 200 success. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put200Async(Boolean booleanValue) { + return put200WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put boolean value true returning 200 success. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put200WithServiceResponseAsync(Boolean booleanValue) { + return service.put200(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put200Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Patch true Boolean value in request returning 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch200() { + patch200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Patch true Boolean value in request returning 200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Patch true Boolean value in request returning 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch200Async() { + return patch200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch true Boolean value in request returning 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch200WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch200(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch true Boolean value in request returning 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch200(Boolean booleanValue) { + patch200WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Patch true Boolean value in request returning 200. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch200Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch200WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Patch true Boolean value in request returning 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch200Async(Boolean booleanValue) { + return patch200WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch true Boolean value in request returning 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch200WithServiceResponseAsync(Boolean booleanValue) { + return service.patch200(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patch200Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post bollean value true in request that returns a 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post200() { + post200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post bollean value true in request that returns a 200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Post bollean value true in request that returns a 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post200Async() { + return post200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post bollean value true in request that returns a 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post200WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post200(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post bollean value true in request that returns a 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post200(Boolean booleanValue) { + post200WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Post bollean value true in request that returns a 200. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post200Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post200WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Post bollean value true in request that returns a 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post200Async(Boolean booleanValue) { + return post200WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post bollean value true in request that returns a 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post200WithServiceResponseAsync(Boolean booleanValue) { + return service.post200(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post200Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Delete simple boolean value true returns 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete200() { + delete200WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Delete simple boolean value true returns 200. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete200Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete200WithServiceResponseAsync(), serviceCallback); + } + + /** + * Delete simple boolean value true returns 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable delete200Async() { + return delete200WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete simple boolean value true returns 200. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> delete200WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete200(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete simple boolean value true returns 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete200(Boolean booleanValue) { + delete200WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Delete simple boolean value true returns 200. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete200Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete200WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Delete simple boolean value true returns 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable delete200Async(Boolean booleanValue) { + return delete200WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete simple boolean value true returns 200. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> delete200WithServiceResponseAsync(Boolean booleanValue) { + return service.delete200(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete200Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse delete200Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put true Boolean value in request returns 201. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put201() { + put201WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put true Boolean value in request returns 201. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201WithServiceResponseAsync(), serviceCallback); + } + + /** + * Put true Boolean value in request returns 201. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put201Async() { + return put201WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put true Boolean value in request returns 201. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put201WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put201(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put201Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put true Boolean value in request returns 201. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put201(Boolean booleanValue) { + put201WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Put true Boolean value in request returns 201. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put201Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put201WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Put true Boolean value in request returns 201. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put201Async(Boolean booleanValue) { + return put201WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put true Boolean value in request returns 201. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put201WithServiceResponseAsync(Boolean booleanValue) { + return service.put201(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put201Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put201Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post201() { + post201WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post201Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post201WithServiceResponseAsync(), serviceCallback); + } + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post201Async() { + return post201WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post201WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post201(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post201Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post201(Boolean booleanValue) { + post201WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post201Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post201WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post201Async(Boolean booleanValue) { + return post201WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post true Boolean value in request returns 201 (Created). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post201WithServiceResponseAsync(Boolean booleanValue) { + return service.post201(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post201Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post201Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put202() { + put202WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put202Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put202WithServiceResponseAsync(), serviceCallback); + } + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put202Async() { + return put202WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put202WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put202(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put202Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put202(Boolean booleanValue) { + put202WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put202Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put202WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put202Async(Boolean booleanValue) { + return put202WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put202WithServiceResponseAsync(Boolean booleanValue) { + return service.put202(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put202Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put202Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Patch true Boolean value in request returns 202. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch202() { + patch202WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Patch true Boolean value in request returns 202. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch202Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch202WithServiceResponseAsync(), serviceCallback); + } + + /** + * Patch true Boolean value in request returns 202. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch202Async() { + return patch202WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch true Boolean value in request returns 202. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch202WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch202(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch202Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch true Boolean value in request returns 202. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch202(Boolean booleanValue) { + patch202WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Patch true Boolean value in request returns 202. + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch202Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch202WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Patch true Boolean value in request returns 202. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch202Async(Boolean booleanValue) { + return patch202WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch true Boolean value in request returns 202. + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch202WithServiceResponseAsync(Boolean booleanValue) { + return service.patch202(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch202Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patch202Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202() { + post202WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post202WithServiceResponseAsync(), serviceCallback); + } + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post202Async() { + return post202WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post202WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post202(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post202Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post202(Boolean booleanValue) { + post202WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post202Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post202WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post202Async(Boolean booleanValue) { + return post202WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post true Boolean value in request returns 202 (Accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post202WithServiceResponseAsync(Boolean booleanValue) { + return service.post202(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post202Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post202Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete202() { + delete202WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete202WithServiceResponseAsync(), serviceCallback); + } + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable delete202Async() { + return delete202WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> delete202WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete202(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete202Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete202(Boolean booleanValue) { + delete202WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete202Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete202WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable delete202Async(Boolean booleanValue) { + return delete202WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete true Boolean value in request returns 202 (accepted). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> delete202WithServiceResponseAsync(Boolean booleanValue) { + return service.delete202(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete202Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse delete202Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head204() { + head204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 204 status code if successful. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head204Async() { + return head204WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 204 status code if successful. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head204WithServiceResponseAsync() { + return service.head204() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head204Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put204() { + put204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put204Async() { + return put204WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put204WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.put204(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void put204(Boolean booleanValue) { + put204WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture put204Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(put204WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable put204Async(Boolean booleanValue) { + return put204WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> put204WithServiceResponseAsync(Boolean booleanValue) { + return service.put204(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = put204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse put204Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch204() { + patch204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch204Async() { + return patch204WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch204WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.patch204(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void patch204(Boolean booleanValue) { + patch204WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture patch204Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(patch204WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable patch204Async(Boolean booleanValue) { + return patch204WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> patch204WithServiceResponseAsync(Boolean booleanValue) { + return service.patch204(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = patch204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse patch204Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post204() { + post204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post204Async() { + return post204WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post204WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.post204(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void post204(Boolean booleanValue) { + post204WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture post204Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(post204WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable post204Async(Boolean booleanValue) { + return post204WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Post true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> post204WithServiceResponseAsync(Boolean booleanValue) { + return service.post204(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = post204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse post204Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete204() { + delete204WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete204Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete204WithServiceResponseAsync(), serviceCallback); + } + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable delete204Async() { + return delete204WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> delete204WithServiceResponseAsync() { + final Boolean booleanValue = null; + return service.delete204(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete204(Boolean booleanValue) { + delete204WithServiceResponseAsync(booleanValue).toBlocking().single().body(); + } + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture delete204Async(Boolean booleanValue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(delete204WithServiceResponseAsync(booleanValue), serviceCallback); + } + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable delete204Async(Boolean booleanValue) { + return delete204WithServiceResponseAsync(booleanValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete true Boolean value in request returns 204 (no content). + * + * @param booleanValue Simple boolean value true + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> delete204WithServiceResponseAsync(Boolean booleanValue) { + return service.delete204(booleanValue) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = delete204Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse delete204Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Return 404 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void head404() { + head404WithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Return 404 status code. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture head404Async(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(head404WithServiceResponseAsync(), serviceCallback); + } + + /** + * Return 404 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable head404Async() { + return head404WithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Return 404 status code. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> head404WithServiceResponseAsync() { + return service.head404() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = head404Delegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse head404Delegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .buildEmpty(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/MultipleResponsesImpl.java b/test/vanilla/src/main/java/fixtures/http/implementation/MultipleResponsesImpl.java new file mode 100644 index 0000000000..84261360d8 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/MultipleResponsesImpl.java @@ -0,0 +1,2431 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.implementation; + +import retrofit2.Retrofit; +import fixtures.http.MultipleResponses; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.models.A; +import fixtures.http.models.B; +import fixtures.http.models.C; +import fixtures.http.models.D; +import fixtures.http.models.ErrorException; +import fixtures.http.models.MyException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MultipleResponses. + */ +public class MultipleResponsesImpl implements MultipleResponses { + /** The Retrofit service to perform REST calls. */ + private MultipleResponsesService service; + /** The service client containing this operation class. */ + private AutoRestHttpInfrastructureTestServiceImpl client; + + /** + * Initializes an instance of MultipleResponses. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MultipleResponsesImpl(Retrofit retrofit, AutoRestHttpInfrastructureTestServiceImpl client) { + this.service = retrofit.create(MultipleResponsesService.class); + this.client = client; + } + + /** + * The interface defining all the services for MultipleResponses to be + * used by Retrofit to perform actually REST calls. + */ + interface MultipleResponsesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200Model204NoModelDefaultError200Valid" }) + @GET("http/payloads/200/A/204/none/default/Error/response/200/valid") + Observable> get200Model204NoModelDefaultError200Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200Model204NoModelDefaultError204Valid" }) + @GET("http/payloads/200/A/204/none/default/Error/response/204/none") + Observable> get200Model204NoModelDefaultError204Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200Model204NoModelDefaultError201Invalid" }) + @GET("http/payloads/200/A/204/none/default/Error/response/201/valid") + Observable> get200Model204NoModelDefaultError201Invalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200Model204NoModelDefaultError202None" }) + @GET("http/payloads/200/A/204/none/default/Error/response/202/none") + Observable> get200Model204NoModelDefaultError202None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200Model204NoModelDefaultError400Valid" }) + @GET("http/payloads/200/A/204/none/default/Error/response/400/valid") + Observable> get200Model204NoModelDefaultError400Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200Model201ModelDefaultError200Valid" }) + @GET("http/payloads/200/A/201/B/default/Error/response/200/valid") + Observable> get200Model201ModelDefaultError200Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200Model201ModelDefaultError201Valid" }) + @GET("http/payloads/200/A/201/B/default/Error/response/201/valid") + Observable> get200Model201ModelDefaultError201Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200Model201ModelDefaultError400Valid" }) + @GET("http/payloads/200/A/201/B/default/Error/response/400/valid") + Observable> get200Model201ModelDefaultError400Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA201ModelC404ModelDDefaultError200Valid" }) + @GET("http/payloads/200/A/201/C/404/D/default/Error/response/200/valid") + Observable> get200ModelA201ModelC404ModelDDefaultError200Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA201ModelC404ModelDDefaultError201Valid" }) + @GET("http/payloads/200/A/201/C/404/D/default/Error/response/201/valid") + Observable> get200ModelA201ModelC404ModelDDefaultError201Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA201ModelC404ModelDDefaultError404Valid" }) + @GET("http/payloads/200/A/201/C/404/D/default/Error/response/404/valid") + Observable> get200ModelA201ModelC404ModelDDefaultError404Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA201ModelC404ModelDDefaultError400Valid" }) + @GET("http/payloads/200/A/201/C/404/D/default/Error/response/400/valid") + Observable> get200ModelA201ModelC404ModelDDefaultError400Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get202None204NoneDefaultError202None" }) + @GET("http/payloads/202/none/204/none/default/Error/response/202/none") + Observable> get202None204NoneDefaultError202None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get202None204NoneDefaultError204None" }) + @GET("http/payloads/202/none/204/none/default/Error/response/204/none") + Observable> get202None204NoneDefaultError204None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get202None204NoneDefaultError400Valid" }) + @GET("http/payloads/202/none/204/none/default/Error/response/400/valid") + Observable> get202None204NoneDefaultError400Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get202None204NoneDefaultNone202Invalid" }) + @GET("http/payloads/202/none/204/none/default/none/response/202/invalid") + Observable> get202None204NoneDefaultNone202Invalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get202None204NoneDefaultNone204None" }) + @GET("http/payloads/202/none/204/none/default/none/response/204/none") + Observable> get202None204NoneDefaultNone204None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get202None204NoneDefaultNone400None" }) + @GET("http/payloads/202/none/204/none/default/none/response/400/none") + Observable> get202None204NoneDefaultNone400None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get202None204NoneDefaultNone400Invalid" }) + @GET("http/payloads/202/none/204/none/default/none/response/400/invalid") + Observable> get202None204NoneDefaultNone400Invalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses getDefaultModelA200Valid" }) + @GET("http/payloads/default/A/response/200/valid") + Observable> getDefaultModelA200Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses getDefaultModelA200None" }) + @GET("http/payloads/default/A/response/200/none") + Observable> getDefaultModelA200None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses getDefaultModelA400Valid" }) + @GET("http/payloads/default/A/response/400/valid") + Observable> getDefaultModelA400Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses getDefaultModelA400None" }) + @GET("http/payloads/default/A/response/400/none") + Observable> getDefaultModelA400None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses getDefaultNone200Invalid" }) + @GET("http/payloads/default/none/response/200/invalid") + Observable> getDefaultNone200Invalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses getDefaultNone200None" }) + @GET("http/payloads/default/none/response/200/none") + Observable> getDefaultNone200None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses getDefaultNone400Invalid" }) + @GET("http/payloads/default/none/response/400/invalid") + Observable> getDefaultNone400Invalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses getDefaultNone400None" }) + @GET("http/payloads/default/none/response/400/none") + Observable> getDefaultNone400None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA200None" }) + @GET("http/payloads/200/A/response/200/none") + Observable> get200ModelA200None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA200Valid" }) + @GET("http/payloads/200/A/response/200/valid") + Observable> get200ModelA200Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA200Invalid" }) + @GET("http/payloads/200/A/response/200/invalid") + Observable> get200ModelA200Invalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA400None" }) + @GET("http/payloads/200/A/response/400/none") + Observable> get200ModelA400None(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA400Valid" }) + @GET("http/payloads/200/A/response/400/valid") + Observable> get200ModelA400Valid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA400Invalid" }) + @GET("http/payloads/200/A/response/400/invalid") + Observable> get200ModelA400Invalid(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.http.MultipleResponses get200ModelA202Valid" }) + @GET("http/payloads/200/A/response/202/valid") + Observable> get200ModelA202Valid(); + + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200Model204NoModelDefaultError200Valid() { + return get200Model204NoModelDefaultError200ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Model204NoModelDefaultError200ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200Model204NoModelDefaultError200ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200Model204NoModelDefaultError200ValidAsync() { + return get200Model204NoModelDefaultError200ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200Model204NoModelDefaultError200ValidWithServiceResponseAsync() { + return service.get200Model204NoModelDefaultError200Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Model204NoModelDefaultError200ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Model204NoModelDefaultError200ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200Model204NoModelDefaultError204Valid() { + return get200Model204NoModelDefaultError204ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 204 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Model204NoModelDefaultError204ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200Model204NoModelDefaultError204ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200Model204NoModelDefaultError204ValidAsync() { + return get200Model204NoModelDefaultError204ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200Model204NoModelDefaultError204ValidWithServiceResponseAsync() { + return service.get200Model204NoModelDefaultError204Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Model204NoModelDefaultError204ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Model204NoModelDefaultError204ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 201 response with valid payload: {'statusCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200Model204NoModelDefaultError201Invalid() { + return get200Model204NoModelDefaultError201InvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 201 response with valid payload: {'statusCode': '201'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Model204NoModelDefaultError201InvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200Model204NoModelDefaultError201InvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 201 response with valid payload: {'statusCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200Model204NoModelDefaultError201InvalidAsync() { + return get200Model204NoModelDefaultError201InvalidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 201 response with valid payload: {'statusCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200Model204NoModelDefaultError201InvalidWithServiceResponseAsync() { + return service.get200Model204NoModelDefaultError201Invalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Model204NoModelDefaultError201InvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Model204NoModelDefaultError201InvalidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 202 response with no payload:. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200Model204NoModelDefaultError202None() { + return get200Model204NoModelDefaultError202NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 202 response with no payload:. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Model204NoModelDefaultError202NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200Model204NoModelDefaultError202NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 202 response with no payload:. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200Model204NoModelDefaultError202NoneAsync() { + return get200Model204NoModelDefaultError202NoneWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 202 response with no payload:. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200Model204NoModelDefaultError202NoneWithServiceResponseAsync() { + return service.get200Model204NoModelDefaultError202None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Model204NoModelDefaultError202NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Model204NoModelDefaultError202NoneDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200Model204NoModelDefaultError400Valid() { + return get200Model204NoModelDefaultError400ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Model204NoModelDefaultError400ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200Model204NoModelDefaultError400ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200Model204NoModelDefaultError400ValidAsync() { + return get200Model204NoModelDefaultError400ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with valid error payload: {'status': 400, 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200Model204NoModelDefaultError400ValidWithServiceResponseAsync() { + return service.get200Model204NoModelDefaultError400Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Model204NoModelDefaultError400ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Model204NoModelDefaultError400ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200Model201ModelDefaultError200Valid() { + return get200Model201ModelDefaultError200ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Model201ModelDefaultError200ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200Model201ModelDefaultError200ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200Model201ModelDefaultError200ValidAsync() { + return get200Model201ModelDefaultError200ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200Model201ModelDefaultError200ValidWithServiceResponseAsync() { + return service.get200Model201ModelDefaultError200Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Model201ModelDefaultError200ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Model201ModelDefaultError200ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200Model201ModelDefaultError201Valid() { + return get200Model201ModelDefaultError201ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Model201ModelDefaultError201ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200Model201ModelDefaultError201ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200Model201ModelDefaultError201ValidAsync() { + return get200Model201ModelDefaultError201ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 201 response with valid payload: {'statusCode': '201', 'textStatusCode': 'Created'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200Model201ModelDefaultError201ValidWithServiceResponseAsync() { + return service.get200Model201ModelDefaultError201Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Model201ModelDefaultError201ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Model201ModelDefaultError201ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200Model201ModelDefaultError400Valid() { + return get200Model201ModelDefaultError400ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200Model201ModelDefaultError400ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200Model201ModelDefaultError400ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200Model201ModelDefaultError400ValidAsync() { + return get200Model201ModelDefaultError400ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200Model201ModelDefaultError400ValidWithServiceResponseAsync() { + return service.get200Model201ModelDefaultError400Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200Model201ModelDefaultError400ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200Model201ModelDefaultError400ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object get200ModelA201ModelC404ModelDDefaultError200Valid() { + return get200ModelA201ModelC404ModelDDefaultError200ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA201ModelC404ModelDDefaultError200ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA201ModelC404ModelDDefaultError200ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable get200ModelA201ModelC404ModelDDefaultError200ValidAsync() { + return get200ModelA201ModelC404ModelDDefaultError200ValidWithServiceResponseAsync().map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> get200ModelA201ModelC404ModelDDefaultError200ValidWithServiceResponseAsync() { + return service.get200ModelA201ModelC404ModelDDefaultError200Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA201ModelC404ModelDDefaultError200ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA201ModelC404ModelDDefaultError200ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 200 response with valid payload: {'httpCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object get200ModelA201ModelC404ModelDDefaultError201Valid() { + return get200ModelA201ModelC404ModelDDefaultError201ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with valid payload: {'httpCode': '201'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA201ModelC404ModelDDefaultError201ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA201ModelC404ModelDDefaultError201ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with valid payload: {'httpCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable get200ModelA201ModelC404ModelDDefaultError201ValidAsync() { + return get200ModelA201ModelC404ModelDDefaultError201ValidWithServiceResponseAsync().map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with valid payload: {'httpCode': '201'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> get200ModelA201ModelC404ModelDDefaultError201ValidWithServiceResponseAsync() { + return service.get200ModelA201ModelC404ModelDDefaultError201Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA201ModelC404ModelDDefaultError201ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA201ModelC404ModelDDefaultError201ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 200 response with valid payload: {'httpStatusCode': '404'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object get200ModelA201ModelC404ModelDDefaultError404Valid() { + return get200ModelA201ModelC404ModelDDefaultError404ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with valid payload: {'httpStatusCode': '404'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA201ModelC404ModelDDefaultError404ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA201ModelC404ModelDDefaultError404ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with valid payload: {'httpStatusCode': '404'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable get200ModelA201ModelC404ModelDDefaultError404ValidAsync() { + return get200ModelA201ModelC404ModelDDefaultError404ValidWithServiceResponseAsync().map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with valid payload: {'httpStatusCode': '404'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> get200ModelA201ModelC404ModelDDefaultError404ValidWithServiceResponseAsync() { + return service.get200ModelA201ModelC404ModelDDefaultError404Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA201ModelC404ModelDDefaultError404ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA201ModelC404ModelDDefaultError404ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Object object if successful. + */ + public Object get200ModelA201ModelC404ModelDDefaultError400Valid() { + return get200ModelA201ModelC404ModelDDefaultError400ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA201ModelC404ModelDDefaultError400ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA201ModelC404ModelDDefaultError400ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable get200ModelA201ModelC404ModelDDefaultError400ValidAsync() { + return get200ModelA201ModelC404ModelDDefaultError400ValidWithServiceResponseAsync().map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Object object + */ + public Observable> get200ModelA201ModelC404ModelDDefaultError400ValidWithServiceResponseAsync() { + return service.get200ModelA201ModelC404ModelDDefaultError400Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA201ModelC404ModelDDefaultError400ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA201ModelC404ModelDDefaultError400ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 202 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get202None204NoneDefaultError202None() { + get202None204NoneDefaultError202NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 202 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get202None204NoneDefaultError202NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get202None204NoneDefaultError202NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 202 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable get202None204NoneDefaultError202NoneAsync() { + return get202None204NoneDefaultError202NoneWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 202 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> get202None204NoneDefaultError202NoneWithServiceResponseAsync() { + return service.get202None204NoneDefaultError202None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get202None204NoneDefaultError202NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get202None204NoneDefaultError202NoneDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get202None204NoneDefaultError204None() { + get202None204NoneDefaultError204NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 204 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get202None204NoneDefaultError204NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get202None204NoneDefaultError204NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable get202None204NoneDefaultError204NoneAsync() { + return get202None204NoneDefaultError204NoneWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> get202None204NoneDefaultError204NoneWithServiceResponseAsync() { + return service.get202None204NoneDefaultError204None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get202None204NoneDefaultError204NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get202None204NoneDefaultError204NoneDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get202None204NoneDefaultError400Valid() { + get202None204NoneDefaultError400ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get202None204NoneDefaultError400ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get202None204NoneDefaultError400ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable get202None204NoneDefaultError400ValidAsync() { + return get202None204NoneDefaultError400ValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with valid payload: {'code': '400', 'message': 'client error'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> get202None204NoneDefaultError400ValidWithServiceResponseAsync() { + return service.get202None204NoneDefaultError400Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get202None204NoneDefaultError400ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get202None204NoneDefaultError400ValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Send a 202 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get202None204NoneDefaultNone202Invalid() { + get202None204NoneDefaultNone202InvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 202 response with an unexpected payload {'property': 'value'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get202None204NoneDefaultNone202InvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get202None204NoneDefaultNone202InvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 202 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable get202None204NoneDefaultNone202InvalidAsync() { + return get202None204NoneDefaultNone202InvalidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 202 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> get202None204NoneDefaultNone202InvalidWithServiceResponseAsync() { + return service.get202None204NoneDefaultNone202Invalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get202None204NoneDefaultNone202InvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get202None204NoneDefaultNone202InvalidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get202None204NoneDefaultNone204None() { + get202None204NoneDefaultNone204NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 204 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get202None204NoneDefaultNone204NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get202None204NoneDefaultNone204NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable get202None204NoneDefaultNone204NoneAsync() { + return get202None204NoneDefaultNone204NoneWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 204 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> get202None204NoneDefaultNone204NoneWithServiceResponseAsync() { + return service.get202None204NoneDefaultNone204None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get202None204NoneDefaultNone204NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get202None204NoneDefaultNone204NoneDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get202None204NoneDefaultNone400None() { + get202None204NoneDefaultNone400NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get202None204NoneDefaultNone400NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get202None204NoneDefaultNone400NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable get202None204NoneDefaultNone400NoneAsync() { + return get202None204NoneDefaultNone400NoneWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> get202None204NoneDefaultNone400NoneWithServiceResponseAsync() { + return service.get202None204NoneDefaultNone400None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get202None204NoneDefaultNone400NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get202None204NoneDefaultNone400NoneDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 400 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void get202None204NoneDefaultNone400Invalid() { + get202None204NoneDefaultNone400InvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with an unexpected payload {'property': 'value'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get202None204NoneDefaultNone400InvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get202None204NoneDefaultNone400InvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable get202None204NoneDefaultNone400InvalidAsync() { + return get202None204NoneDefaultNone400InvalidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with an unexpected payload {'property': 'value'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> get202None204NoneDefaultNone400InvalidWithServiceResponseAsync() { + return service.get202None204NoneDefaultNone400Invalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get202None204NoneDefaultNone400InvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get202None204NoneDefaultNone400InvalidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws MyException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A getDefaultModelA200Valid() { + return getDefaultModelA200ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultModelA200ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultModelA200ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable getDefaultModelA200ValidAsync() { + return getDefaultModelA200ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with valid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> getDefaultModelA200ValidWithServiceResponseAsync() { + return service.getDefaultModelA200Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultModelA200ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultModelA200ValidDelegate(Response response) throws MyException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(MyException.class) + .build(response); + } + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws MyException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A getDefaultModelA200None() { + return getDefaultModelA200NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultModelA200NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultModelA200NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable getDefaultModelA200NoneAsync() { + return getDefaultModelA200NoneWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> getDefaultModelA200NoneWithServiceResponseAsync() { + return service.getDefaultModelA200None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultModelA200NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultModelA200NoneDelegate(Response response) throws MyException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(MyException.class) + .build(response); + } + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws MyException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A getDefaultModelA400Valid() { + return getDefaultModelA400ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultModelA400ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultModelA400ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable getDefaultModelA400ValidAsync() { + return getDefaultModelA400ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> getDefaultModelA400ValidWithServiceResponseAsync() { + return service.getDefaultModelA400Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultModelA400ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultModelA400ValidDelegate(Response response) throws MyException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(MyException.class) + .build(response); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws MyException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A getDefaultModelA400None() { + return getDefaultModelA400NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultModelA400NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultModelA400NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable getDefaultModelA400NoneAsync() { + return getDefaultModelA400NoneWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> getDefaultModelA400NoneWithServiceResponseAsync() { + return service.getDefaultModelA400None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultModelA400NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultModelA400NoneDelegate(Response response) throws MyException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(MyException.class) + .build(response); + } + + /** + * Send a 200 response with invalid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getDefaultNone200Invalid() { + getDefaultNone200InvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with invalid payload: {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultNone200InvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultNone200InvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with invalid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getDefaultNone200InvalidAsync() { + return getDefaultNone200InvalidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with invalid payload: {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getDefaultNone200InvalidWithServiceResponseAsync() { + return service.getDefaultNone200Invalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultNone200InvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultNone200InvalidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .build(response); + } + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getDefaultNone200None() { + getDefaultNone200NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultNone200NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultNone200NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getDefaultNone200NoneAsync() { + return getDefaultNone200NoneWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getDefaultNone200NoneWithServiceResponseAsync() { + return service.getDefaultNone200None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultNone200NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultNone200NoneDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .build(response); + } + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getDefaultNone400Invalid() { + getDefaultNone400InvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultNone400InvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultNone400InvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getDefaultNone400InvalidAsync() { + return getDefaultNone400InvalidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with valid payload: {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getDefaultNone400InvalidWithServiceResponseAsync() { + return service.getDefaultNone400Invalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultNone400InvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultNone400InvalidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .build(response); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getDefaultNone400None() { + getDefaultNone400NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with no payload. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDefaultNone400NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDefaultNone400NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getDefaultNone400NoneAsync() { + return getDefaultNone400NoneWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with no payload. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getDefaultNone400NoneWithServiceResponseAsync() { + return service.getDefaultNone400None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDefaultNone400NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDefaultNone400NoneDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .build(response); + } + + /** + * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200ModelA200None() { + return get200ModelA200NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA200NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA200NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200ModelA200NoneAsync() { + return get200ModelA200NoneWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with no payload, when a payload is expected - client should return a null object of thde type for model A. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200ModelA200NoneWithServiceResponseAsync() { + return service.get200ModelA200None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA200NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA200NoneDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 200 response with payload {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200ModelA200Valid() { + return get200ModelA200ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with payload {'statusCode': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA200ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA200ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with payload {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200ModelA200ValidAsync() { + return get200ModelA200ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with payload {'statusCode': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200ModelA200ValidWithServiceResponseAsync() { + return service.get200ModelA200Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA200ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA200ValidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200ModelA200Invalid() { + return get200ModelA200InvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA200InvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA200InvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200ModelA200InvalidAsync() { + return get200ModelA200InvalidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '200'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200ModelA200InvalidWithServiceResponseAsync() { + return service.get200ModelA200Invalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA200InvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA200InvalidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 400 response with no payload client should treat as an http error with no error model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200ModelA400None() { + return get200ModelA400NoneWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 400 response with no payload client should treat as an http error with no error model. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA400NoneAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA400NoneWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 400 response with no payload client should treat as an http error with no error model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200ModelA400NoneAsync() { + return get200ModelA400NoneWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 400 response with no payload client should treat as an http error with no error model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200ModelA400NoneWithServiceResponseAsync() { + return service.get200ModelA400None() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA400NoneDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA400NoneDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 200 response with payload {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200ModelA400Valid() { + return get200ModelA400ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with payload {'statusCode': '400'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA400ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA400ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with payload {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200ModelA400ValidAsync() { + return get200ModelA400ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with payload {'statusCode': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200ModelA400ValidWithServiceResponseAsync() { + return service.get200ModelA400Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA400ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA400ValidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200ModelA400Invalid() { + return get200ModelA400InvalidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA400InvalidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA400InvalidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200ModelA400InvalidAsync() { + return get200ModelA400InvalidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 200 response with invalid payload {'statusCodeInvalid': '400'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200ModelA400InvalidWithServiceResponseAsync() { + return service.get200ModelA400Invalid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA400InvalidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA400InvalidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * Send a 202 response with payload {'statusCode': '202'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the A object if successful. + */ + public A get200ModelA202Valid() { + return get200ModelA202ValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Send a 202 response with payload {'statusCode': '202'}. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture get200ModelA202ValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(get200ModelA202ValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Send a 202 response with payload {'statusCode': '202'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable get200ModelA202ValidAsync() { + return get200ModelA202ValidWithServiceResponseAsync().map(new Func1, A>() { + @Override + public A call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Send a 202 response with payload {'statusCode': '202'}. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the A object + */ + public Observable> get200ModelA202ValidWithServiceResponseAsync() { + return service.get200ModelA202Valid() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = get200ModelA202ValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse get200ModelA202ValidDelegate(Response response) throws RestException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/http/implementation/package-info.java new file mode 100644 index 0000000000..6762e615ae --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestHttpInfrastructureTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.http.implementation; diff --git a/test/vanilla/src/main/java/fixtures/http/models/A.java b/test/vanilla/src/main/java/fixtures/http/models/A.java new file mode 100644 index 0000000000..7b981b0ceb --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/A.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The A model. + */ +public class A { + /** + * The statusCode property. + */ + @JsonProperty(value = "statusCode") + private String statusCode; + + /** + * Get the statusCode value. + * + * @return the statusCode value + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the statusCode value. + * + * @param statusCode the statusCode value to set + * @return the A object itself. + */ + public A withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/B.java b/test/vanilla/src/main/java/fixtures/http/models/B.java new file mode 100644 index 0000000000..3f02227d50 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/B.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The B model. + */ +public class B extends A { + /** + * The textStatusCode property. + */ + @JsonProperty(value = "textStatusCode") + private String textStatusCode; + + /** + * Get the textStatusCode value. + * + * @return the textStatusCode value + */ + public String textStatusCode() { + return this.textStatusCode; + } + + /** + * Set the textStatusCode value. + * + * @param textStatusCode the textStatusCode value to set + * @return the B object itself. + */ + public B withTextStatusCode(String textStatusCode) { + this.textStatusCode = textStatusCode; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/C.java b/test/vanilla/src/main/java/fixtures/http/models/C.java new file mode 100644 index 0000000000..f35c020805 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/C.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The C model. + */ +public class C { + /** + * The httpCode property. + */ + @JsonProperty(value = "httpCode") + private String httpCode; + + /** + * Get the httpCode value. + * + * @return the httpCode value + */ + public String httpCode() { + return this.httpCode; + } + + /** + * Set the httpCode value. + * + * @param httpCode the httpCode value to set + * @return the C object itself. + */ + public C withHttpCode(String httpCode) { + this.httpCode = httpCode; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/D.java b/test/vanilla/src/main/java/fixtures/http/models/D.java new file mode 100644 index 0000000000..5755ce9bee --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/D.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The D model. + */ +public class D { + /** + * The httpStatusCode property. + */ + @JsonProperty(value = "httpStatusCode") + private String httpStatusCode; + + /** + * Get the httpStatusCode value. + * + * @return the httpStatusCode value + */ + public String httpStatusCode() { + return this.httpStatusCode; + } + + /** + * Set the httpStatusCode value. + * + * @param httpStatusCode the httpStatusCode value to set + * @return the D object itself. + */ + public D withHttpStatusCode(String httpStatusCode) { + this.httpStatusCode = httpStatusCode; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/Error.java b/test/vanilla/src/main/java/fixtures/http/models/Error.java new file mode 100644 index 0000000000..2b869f0ba1 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/http/models/ErrorException.java new file mode 100644 index 0000000000..2146a05f23 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsDelete307Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsDelete307Headers.java new file mode 100644 index 0000000000..9667c3480d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsDelete307Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for delete307 operation. + */ +public class HttpRedirectsDelete307Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/delete/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsDelete307Headers object itself. + */ + public HttpRedirectsDelete307Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet300Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet300Headers.java new file mode 100644 index 0000000000..c4d1d1d6a1 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet300Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for get300 operation. + */ +public class HttpRedirectsGet300Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/get/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsGet300Headers object itself. + */ + public HttpRedirectsGet300Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet301Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet301Headers.java new file mode 100644 index 0000000000..69ca8d5fde --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet301Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for get301 operation. + */ +public class HttpRedirectsGet301Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/get/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsGet301Headers object itself. + */ + public HttpRedirectsGet301Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet302Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet302Headers.java new file mode 100644 index 0000000000..c51fef8405 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet302Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for get302 operation. + */ +public class HttpRedirectsGet302Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/get/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsGet302Headers object itself. + */ + public HttpRedirectsGet302Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet307Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet307Headers.java new file mode 100644 index 0000000000..4335d60498 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsGet307Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for get307 operation. + */ +public class HttpRedirectsGet307Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/get/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsGet307Headers object itself. + */ + public HttpRedirectsGet307Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead300Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead300Headers.java new file mode 100644 index 0000000000..710a8a0379 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead300Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for head300 operation. + */ +public class HttpRedirectsHead300Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/head/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsHead300Headers object itself. + */ + public HttpRedirectsHead300Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead301Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead301Headers.java new file mode 100644 index 0000000000..5bb4e41af0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead301Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for head301 operation. + */ +public class HttpRedirectsHead301Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/head/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsHead301Headers object itself. + */ + public HttpRedirectsHead301Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead302Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead302Headers.java new file mode 100644 index 0000000000..c9d59d69c9 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead302Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for head302 operation. + */ +public class HttpRedirectsHead302Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/head/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsHead302Headers object itself. + */ + public HttpRedirectsHead302Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead307Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead307Headers.java new file mode 100644 index 0000000000..1d09d77237 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsHead307Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for head307 operation. + */ +public class HttpRedirectsHead307Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/head/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsHead307Headers object itself. + */ + public HttpRedirectsHead307Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPatch302Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPatch302Headers.java new file mode 100644 index 0000000000..3e4b5018b8 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPatch302Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for patch302 operation. + */ +public class HttpRedirectsPatch302Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/failure/500'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsPatch302Headers object itself. + */ + public HttpRedirectsPatch302Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPatch307Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPatch307Headers.java new file mode 100644 index 0000000000..4bb7ded868 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPatch307Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for patch307 operation. + */ +public class HttpRedirectsPatch307Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/patch/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsPatch307Headers object itself. + */ + public HttpRedirectsPatch307Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPost303Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPost303Headers.java new file mode 100644 index 0000000000..387934f394 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPost303Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post303 operation. + */ +public class HttpRedirectsPost303Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/get/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsPost303Headers object itself. + */ + public HttpRedirectsPost303Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPost307Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPost307Headers.java new file mode 100644 index 0000000000..cdf2d2da54 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPost307Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for post307 operation. + */ +public class HttpRedirectsPost307Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/post/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsPost307Headers object itself. + */ + public HttpRedirectsPost307Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPut301Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPut301Headers.java new file mode 100644 index 0000000000..ae3cdf5e67 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPut301Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for put301 operation. + */ +public class HttpRedirectsPut301Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/failure/500'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsPut301Headers object itself. + */ + public HttpRedirectsPut301Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPut307Headers.java b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPut307Headers.java new file mode 100644 index 0000000000..2798b8156a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/HttpRedirectsPut307Headers.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for put307 operation. + */ +public class HttpRedirectsPut307Headers { + /** + * The redirect location for this request. Possible values include: + * '/http/success/put/200'. + */ + @JsonProperty(value = "Location") + private String location; + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the HttpRedirectsPut307Headers object itself. + */ + public HttpRedirectsPut307Headers withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/MyException.java b/test/vanilla/src/main/java/fixtures/http/models/MyException.java new file mode 100644 index 0000000000..692726eb50 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/MyException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.http.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with A information. + */ +public class MyException extends RestException { + /** + * Initializes a new instance of the MyException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public MyException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the MyException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public MyException(final String message, final Response response, final A body) { + super(message, response, body); + } + + @Override + public A body() { + return (A) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/http/models/package-info.java b/test/vanilla/src/main/java/fixtures/http/models/package-info.java new file mode 100644 index 0000000000..680cfa1d17 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestHttpInfrastructureTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.http.models; diff --git a/test/vanilla/src/main/java/fixtures/http/package-info.java b/test/vanilla/src/main/java/fixtures/http/package-info.java new file mode 100644 index 0000000000..c00c46f628 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/http/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestHttpInfrastructureTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.http; diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/AutoRestResourceFlatteningTestService.java b/test/vanilla/src/main/java/fixtures/modelflattening/AutoRestResourceFlatteningTestService.java new file mode 100644 index 0000000000..5a461683b2 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/AutoRestResourceFlatteningTestService.java @@ -0,0 +1,679 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.modelflattening.models.ErrorException; +import fixtures.modelflattening.models.FlattenedProduct; +import fixtures.modelflattening.models.FlattenParameterGroup; +import fixtures.modelflattening.models.ProductWrapper; +import fixtures.modelflattening.models.Resource; +import fixtures.modelflattening.models.ResourceCollection; +import fixtures.modelflattening.models.SimpleProduct; +import fixtures.modelflattening.models.WrappedProduct; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import rx.Observable; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestResourceFlatteningTestService class. + */ +public interface AutoRestResourceFlatteningTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putArray(); + + /** + * Put External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putArrayAsync(final ServiceCallback serviceCallback); + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putArrayAsync(); + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putArrayWithServiceResponseAsync(); + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putArray(List resourceArray); + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putArrayAsync(List resourceArray, final ServiceCallback serviceCallback); + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putArrayAsync(List resourceArray); + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putArrayWithServiceResponseAsync(List resourceArray); + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FlattenedProduct> object if successful. + */ + List getArray(); + + /** + * Get External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getArrayAsync(final ServiceCallback> serviceCallback); + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProduct> object + */ + Observable> getArrayAsync(); + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProduct> object + */ + Observable>> getArrayWithServiceResponseAsync(); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putWrappedArray(); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putWrappedArrayAsync(final ServiceCallback serviceCallback); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putWrappedArrayAsync(); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putWrappedArrayWithServiceResponseAsync(); + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putWrappedArray(List resourceArray); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param resourceArray External Resource as an Array to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putWrappedArrayAsync(List resourceArray, final ServiceCallback serviceCallback); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putWrappedArrayAsync(List resourceArray); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putWrappedArrayWithServiceResponseAsync(List resourceArray); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ProductWrapper> object if successful. + */ + List getWrappedArray(); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getWrappedArrayAsync(final ServiceCallback> serviceCallback); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProductWrapper> object + */ + Observable> getWrappedArrayAsync(); + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProductWrapper> object + */ + Observable>> getWrappedArrayWithServiceResponseAsync(); + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDictionary(); + + /** + * Put External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDictionaryAsync(final ServiceCallback serviceCallback); + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDictionaryAsync(); + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDictionaryWithServiceResponseAsync(); + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putDictionary(Map resourceDictionary); + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putDictionaryAsync(Map resourceDictionary, final ServiceCallback serviceCallback); + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putDictionaryAsync(Map resourceDictionary); + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putDictionaryWithServiceResponseAsync(Map resourceDictionary); + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, FlattenedProduct> object if successful. + */ + Map getDictionary(); + + /** + * Get External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getDictionaryAsync(final ServiceCallback> serviceCallback); + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProduct> object + */ + Observable> getDictionaryAsync(); + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProduct> object + */ + Observable>> getDictionaryWithServiceResponseAsync(); + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putResourceCollection(); + + /** + * Put External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putResourceCollectionAsync(final ServiceCallback serviceCallback); + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putResourceCollectionAsync(); + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putResourceCollectionWithServiceResponseAsync(); + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putResourceCollection(ResourceCollection resourceComplexObject); + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putResourceCollectionAsync(ResourceCollection resourceComplexObject, final ServiceCallback serviceCallback); + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putResourceCollectionAsync(ResourceCollection resourceComplexObject); + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putResourceCollectionWithServiceResponseAsync(ResourceCollection resourceComplexObject); + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceCollection object if successful. + */ + ResourceCollection getResourceCollection(); + + /** + * Get External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getResourceCollectionAsync(final ServiceCallback serviceCallback); + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollection object + */ + Observable getResourceCollectionAsync(); + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollection object + */ + Observable> getResourceCollectionWithServiceResponseAsync(); + + /** + * Put Simple Product with client flattening true on the model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + SimpleProduct putSimpleProduct(); + + /** + * Put Simple Product with client flattening true on the model. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putSimpleProductAsync(final ServiceCallback serviceCallback); + + /** + * Put Simple Product with client flattening true on the model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable putSimpleProductAsync(); + + /** + * Put Simple Product with client flattening true on the model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable> putSimpleProductWithServiceResponseAsync(); + /** + * Put Simple Product with client flattening true on the model. + * + * @param simpleBodyProduct Simple body product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + SimpleProduct putSimpleProduct(SimpleProduct simpleBodyProduct); + + /** + * Put Simple Product with client flattening true on the model. + * + * @param simpleBodyProduct Simple body product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putSimpleProductAsync(SimpleProduct simpleBodyProduct, final ServiceCallback serviceCallback); + + /** + * Put Simple Product with client flattening true on the model. + * + * @param simpleBodyProduct Simple body product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable putSimpleProductAsync(SimpleProduct simpleBodyProduct); + + /** + * Put Simple Product with client flattening true on the model. + * + * @param simpleBodyProduct Simple body product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable> putSimpleProductWithServiceResponseAsync(SimpleProduct simpleBodyProduct); + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + SimpleProduct postFlattenedSimpleProduct(String productId, String maxProductDisplayName); + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postFlattenedSimpleProductAsync(String productId, String maxProductDisplayName, final ServiceCallback serviceCallback); + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable postFlattenedSimpleProductAsync(String productId, String maxProductDisplayName); + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable> postFlattenedSimpleProductWithServiceResponseAsync(String productId, String maxProductDisplayName); + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param description Description of product. + * @param genericValue Generic URL value. + * @param odatavalue URL value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + SimpleProduct postFlattenedSimpleProduct(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue); + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param description Description of product. + * @param genericValue Generic URL value. + * @param odatavalue URL value. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postFlattenedSimpleProductAsync(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue, final ServiceCallback serviceCallback); + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param description Description of product. + * @param genericValue Generic URL value. + * @param odatavalue URL value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable postFlattenedSimpleProductAsync(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue); + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param description Description of product. + * @param genericValue Generic URL value. + * @param odatavalue URL value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable> postFlattenedSimpleProductWithServiceResponseAsync(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue); + + /** + * Put Simple Product with client flattening true on the model. + * + * @param flattenParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + SimpleProduct putSimpleProductWithGrouping(FlattenParameterGroup flattenParameterGroup); + + /** + * Put Simple Product with client flattening true on the model. + * + * @param flattenParameterGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putSimpleProductWithGroupingAsync(FlattenParameterGroup flattenParameterGroup, final ServiceCallback serviceCallback); + + /** + * Put Simple Product with client flattening true on the model. + * + * @param flattenParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable putSimpleProductWithGroupingAsync(FlattenParameterGroup flattenParameterGroup); + + /** + * Put Simple Product with client flattening true on the model. + * + * @param flattenParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + Observable> putSimpleProductWithGroupingWithServiceResponseAsync(FlattenParameterGroup flattenParameterGroup); + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/implementation/AutoRestResourceFlatteningTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/modelflattening/implementation/AutoRestResourceFlatteningTestServiceImpl.java new file mode 100644 index 0000000000..e07397b47a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/implementation/AutoRestResourceFlatteningTestServiceImpl.java @@ -0,0 +1,1346 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.implementation; + +import fixtures.modelflattening.AutoRestResourceFlatteningTestService; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.modelflattening.models.ErrorException; +import fixtures.modelflattening.models.FlattenedProduct; +import fixtures.modelflattening.models.FlattenParameterGroup; +import fixtures.modelflattening.models.ProductWrapper; +import fixtures.modelflattening.models.Resource; +import fixtures.modelflattening.models.ResourceCollection; +import fixtures.modelflattening.models.SimpleProduct; +import fixtures.modelflattening.models.WrappedProduct; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the AutoRestResourceFlatteningTestService class. + */ +public class AutoRestResourceFlatteningTestServiceImpl extends ServiceClient implements AutoRestResourceFlatteningTestService { + /** + * The Retrofit service to perform REST calls. + */ + private AutoRestResourceFlatteningTestServiceService service; + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + */ + public AutoRestResourceFlatteningTestServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestResourceFlatteningTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestResourceFlatteningTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestResourceFlatteningTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestResourceFlatteningTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestResourceFlatteningTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + initializeService(); + } + + private void initializeService() { + service = retrofit().create(AutoRestResourceFlatteningTestServiceService.class); + } + + /** + * The interface defining all the services for AutoRestResourceFlatteningTestService to be + * used by Retrofit to perform actually REST calls. + */ + interface AutoRestResourceFlatteningTestServiceService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService putArray" }) + @PUT("model-flatten/array") + Observable> putArray(@Body List resourceArray); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService getArray" }) + @GET("model-flatten/array") + Observable> getArray(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService putWrappedArray" }) + @PUT("model-flatten/wrappedarray") + Observable> putWrappedArray(@Body List resourceArray); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService getWrappedArray" }) + @GET("model-flatten/wrappedarray") + Observable> getWrappedArray(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService putDictionary" }) + @PUT("model-flatten/dictionary") + Observable> putDictionary(@Body Map resourceDictionary); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService getDictionary" }) + @GET("model-flatten/dictionary") + Observable> getDictionary(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService putResourceCollection" }) + @PUT("model-flatten/resourcecollection") + Observable> putResourceCollection(@Body ResourceCollection resourceComplexObject); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService getResourceCollection" }) + @GET("model-flatten/resourcecollection") + Observable> getResourceCollection(); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService putSimpleProduct" }) + @PUT("model-flatten/customFlattening") + Observable> putSimpleProduct(@Body SimpleProduct simpleBodyProduct); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService postFlattenedSimpleProduct" }) + @POST("model-flatten/customFlattening") + Observable> postFlattenedSimpleProduct(@Body SimpleProduct simpleBodyProduct); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.modelflattening.AutoRestResourceFlatteningTestService putSimpleProductWithGrouping" }) + @PUT("model-flatten/customFlattening/parametergrouping/{name}/") + Observable> putSimpleProductWithGrouping(@Path("name") String name, @Body SimpleProduct simpleBodyProduct); + + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putArray() { + putArrayWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putArrayAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putArrayWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putArrayAsync() { + return putArrayWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putArrayWithServiceResponseAsync() { + final List resourceArray = null; + return service.putArray(resourceArray) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putArray(List resourceArray) { + putArrayWithServiceResponseAsync(resourceArray).toBlocking().single().body(); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putArrayAsync(List resourceArray, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putArrayWithServiceResponseAsync(resourceArray), serviceCallback); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putArrayAsync(List resourceArray) { + return putArrayWithServiceResponseAsync(resourceArray).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as an Array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putArrayWithServiceResponseAsync(List resourceArray) { + Validator.validate(resourceArray); + return service.putArray(resourceArray) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putArrayDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<FlattenedProduct> object if successful. + */ + public List getArray() { + return getArrayWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as an Array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getArrayAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getArrayWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProduct> object + */ + public Observable> getArrayAsync() { + return getArrayWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as an Array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<FlattenedProduct> object + */ + public Observable>> getArrayWithServiceResponseAsync() { + return service.getArray() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getArrayDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putWrappedArray() { + putWrappedArrayWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putWrappedArrayAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWrappedArrayWithServiceResponseAsync(), serviceCallback); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putWrappedArrayAsync() { + return putWrappedArrayWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putWrappedArrayWithServiceResponseAsync() { + final List resourceArray = null; + return service.putWrappedArray(resourceArray) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putWrappedArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putWrappedArray(List resourceArray) { + putWrappedArrayWithServiceResponseAsync(resourceArray).toBlocking().single().body(); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param resourceArray External Resource as an Array to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putWrappedArrayAsync(List resourceArray, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putWrappedArrayWithServiceResponseAsync(resourceArray), serviceCallback); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putWrappedArrayAsync(List resourceArray) { + return putWrappedArrayWithServiceResponseAsync(resourceArray).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param resourceArray External Resource as an Array to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putWrappedArrayWithServiceResponseAsync(List resourceArray) { + Validator.validate(resourceArray); + return service.putWrappedArray(resourceArray) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putWrappedArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putWrappedArrayDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<ProductWrapper> object if successful. + */ + public List getWrappedArray() { + return getWrappedArrayWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getWrappedArrayAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getWrappedArrayWithServiceResponseAsync(), serviceCallback); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProductWrapper> object + */ + public Observable> getWrappedArrayAsync() { + return getWrappedArrayWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * No need to have a route in Express server for this operation. Used to verify the type flattened is not removed if it's referenced in an array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ProductWrapper> object + */ + public Observable>> getWrappedArrayWithServiceResponseAsync() { + return service.getWrappedArray() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getWrappedArrayDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getWrappedArrayDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDictionary() { + putDictionaryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDictionaryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDictionaryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDictionaryAsync() { + return putDictionaryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDictionaryWithServiceResponseAsync() { + final Map resourceDictionary = null; + return service.putDictionary(resourceDictionary) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putDictionary(Map resourceDictionary) { + putDictionaryWithServiceResponseAsync(resourceDictionary).toBlocking().single().body(); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putDictionaryAsync(Map resourceDictionary, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putDictionaryWithServiceResponseAsync(resourceDictionary), serviceCallback); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putDictionaryAsync(Map resourceDictionary) { + return putDictionaryWithServiceResponseAsync(resourceDictionary).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a Dictionary. + * + * @param resourceDictionary External Resource as a Dictionary to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putDictionaryWithServiceResponseAsync(Map resourceDictionary) { + Validator.validate(resourceDictionary); + return service.putDictionary(resourceDictionary) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putDictionaryDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, FlattenedProduct> object if successful. + */ + public Map getDictionary() { + return getDictionaryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as a Dictionary. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getDictionaryAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getDictionaryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProduct> object + */ + public Observable> getDictionaryAsync() { + return getDictionaryWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as a Dictionary. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, FlattenedProduct> object + */ + public Observable>> getDictionaryWithServiceResponseAsync() { + return service.getDictionary() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getDictionaryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getDictionaryDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putResourceCollection() { + putResourceCollectionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putResourceCollectionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putResourceCollectionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putResourceCollectionAsync() { + return putResourceCollectionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putResourceCollectionWithServiceResponseAsync() { + final ResourceCollection resourceComplexObject = null; + return service.putResourceCollection(resourceComplexObject) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putResourceCollection(ResourceCollection resourceComplexObject) { + putResourceCollectionWithServiceResponseAsync(resourceComplexObject).toBlocking().single().body(); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putResourceCollectionAsync(ResourceCollection resourceComplexObject, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putResourceCollectionWithServiceResponseAsync(resourceComplexObject), serviceCallback); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putResourceCollectionAsync(ResourceCollection resourceComplexObject) { + return putResourceCollectionWithServiceResponseAsync(resourceComplexObject).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put External Resource as a ResourceCollection. + * + * @param resourceComplexObject External Resource as a ResourceCollection to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putResourceCollectionWithServiceResponseAsync(ResourceCollection resourceComplexObject) { + Validator.validate(resourceComplexObject); + return service.putResourceCollection(resourceComplexObject) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putResourceCollectionDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ResourceCollection object if successful. + */ + public ResourceCollection getResourceCollection() { + return getResourceCollectionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getResourceCollectionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getResourceCollectionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollection object + */ + public Observable getResourceCollectionAsync() { + return getResourceCollectionWithServiceResponseAsync().map(new Func1, ResourceCollection>() { + @Override + public ResourceCollection call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get External Resource as a ResourceCollection. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ResourceCollection object + */ + public Observable> getResourceCollectionWithServiceResponseAsync() { + return service.getResourceCollection() + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getResourceCollectionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getResourceCollectionDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + public SimpleProduct putSimpleProduct() { + return putSimpleProductWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSimpleProductAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSimpleProductWithServiceResponseAsync(), serviceCallback); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable putSimpleProductAsync() { + return putSimpleProductWithServiceResponseAsync().map(new Func1, SimpleProduct>() { + @Override + public SimpleProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable> putSimpleProductWithServiceResponseAsync() { + final SimpleProduct simpleBodyProduct = null; + return service.putSimpleProduct(simpleBodyProduct) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putSimpleProductDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param simpleBodyProduct Simple body product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + public SimpleProduct putSimpleProduct(SimpleProduct simpleBodyProduct) { + return putSimpleProductWithServiceResponseAsync(simpleBodyProduct).toBlocking().single().body(); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param simpleBodyProduct Simple body product to put + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSimpleProductAsync(SimpleProduct simpleBodyProduct, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSimpleProductWithServiceResponseAsync(simpleBodyProduct), serviceCallback); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param simpleBodyProduct Simple body product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable putSimpleProductAsync(SimpleProduct simpleBodyProduct) { + return putSimpleProductWithServiceResponseAsync(simpleBodyProduct).map(new Func1, SimpleProduct>() { + @Override + public SimpleProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param simpleBodyProduct Simple body product to put + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable> putSimpleProductWithServiceResponseAsync(SimpleProduct simpleBodyProduct) { + Validator.validate(simpleBodyProduct); + return service.putSimpleProduct(simpleBodyProduct) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putSimpleProductDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putSimpleProductDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + public SimpleProduct postFlattenedSimpleProduct(String productId, String maxProductDisplayName) { + return postFlattenedSimpleProductWithServiceResponseAsync(productId, maxProductDisplayName).toBlocking().single().body(); + } + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postFlattenedSimpleProductAsync(String productId, String maxProductDisplayName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postFlattenedSimpleProductWithServiceResponseAsync(productId, maxProductDisplayName), serviceCallback); + } + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable postFlattenedSimpleProductAsync(String productId, String maxProductDisplayName) { + return postFlattenedSimpleProductWithServiceResponseAsync(productId, maxProductDisplayName).map(new Func1, SimpleProduct>() { + @Override + public SimpleProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable> postFlattenedSimpleProductWithServiceResponseAsync(String productId, String maxProductDisplayName) { + if (productId == null) { + throw new IllegalArgumentException("Parameter productId is required and cannot be null."); + } + if (maxProductDisplayName == null) { + throw new IllegalArgumentException("Parameter maxProductDisplayName is required and cannot be null."); + } + final String description = null; + final String genericValue = null; + final String odatavalue = null; + SimpleProduct simpleBodyProduct = new SimpleProduct(); + simpleBodyProduct.withProductId(productId); + simpleBodyProduct.withDescription(null); + simpleBodyProduct.withMaxProductDisplayName(maxProductDisplayName); + simpleBodyProduct.withGenericValue(null); + simpleBodyProduct.withOdatavalue(null); + return service.postFlattenedSimpleProduct(simpleBodyProduct) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postFlattenedSimpleProductDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param description Description of product. + * @param genericValue Generic URL value. + * @param odatavalue URL value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + public SimpleProduct postFlattenedSimpleProduct(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue) { + return postFlattenedSimpleProductWithServiceResponseAsync(productId, maxProductDisplayName, description, genericValue, odatavalue).toBlocking().single().body(); + } + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param description Description of product. + * @param genericValue Generic URL value. + * @param odatavalue URL value. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postFlattenedSimpleProductAsync(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postFlattenedSimpleProductWithServiceResponseAsync(productId, maxProductDisplayName, description, genericValue, odatavalue), serviceCallback); + } + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param description Description of product. + * @param genericValue Generic URL value. + * @param odatavalue URL value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable postFlattenedSimpleProductAsync(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue) { + return postFlattenedSimpleProductWithServiceResponseAsync(productId, maxProductDisplayName, description, genericValue, odatavalue).map(new Func1, SimpleProduct>() { + @Override + public SimpleProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put Flattened Simple Product with client flattening true on the parameter. + * + * @param productId Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. + * @param maxProductDisplayName Display name of product. + * @param description Description of product. + * @param genericValue Generic URL value. + * @param odatavalue URL value. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable> postFlattenedSimpleProductWithServiceResponseAsync(String productId, String maxProductDisplayName, String description, String genericValue, String odatavalue) { + if (productId == null) { + throw new IllegalArgumentException("Parameter productId is required and cannot be null."); + } + if (maxProductDisplayName == null) { + throw new IllegalArgumentException("Parameter maxProductDisplayName is required and cannot be null."); + } + SimpleProduct simpleBodyProduct = null; + if (description != null || genericValue != null || odatavalue != null) { + simpleBodyProduct = new SimpleProduct(); + simpleBodyProduct.withProductId(productId); + simpleBodyProduct.withDescription(description); + simpleBodyProduct.withMaxProductDisplayName(maxProductDisplayName); + simpleBodyProduct.withGenericValue(genericValue); + simpleBodyProduct.withOdatavalue(odatavalue); + } + return service.postFlattenedSimpleProduct(simpleBodyProduct) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postFlattenedSimpleProductDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postFlattenedSimpleProductDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param flattenParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SimpleProduct object if successful. + */ + public SimpleProduct putSimpleProductWithGrouping(FlattenParameterGroup flattenParameterGroup) { + return putSimpleProductWithGroupingWithServiceResponseAsync(flattenParameterGroup).toBlocking().single().body(); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param flattenParameterGroup Additional parameters for the operation + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putSimpleProductWithGroupingAsync(FlattenParameterGroup flattenParameterGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putSimpleProductWithGroupingWithServiceResponseAsync(flattenParameterGroup), serviceCallback); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param flattenParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable putSimpleProductWithGroupingAsync(FlattenParameterGroup flattenParameterGroup) { + return putSimpleProductWithGroupingWithServiceResponseAsync(flattenParameterGroup).map(new Func1, SimpleProduct>() { + @Override + public SimpleProduct call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Put Simple Product with client flattening true on the model. + * + * @param flattenParameterGroup Additional parameters for the operation + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SimpleProduct object + */ + public Observable> putSimpleProductWithGroupingWithServiceResponseAsync(FlattenParameterGroup flattenParameterGroup) { + if (flattenParameterGroup == null) { + throw new IllegalArgumentException("Parameter flattenParameterGroup is required and cannot be null."); + } + Validator.validate(flattenParameterGroup); + String name = flattenParameterGroup.name(); + String productId = flattenParameterGroup.productId(); + String description = flattenParameterGroup.description(); + String maxProductDisplayName = flattenParameterGroup.maxProductDisplayName(); + String genericValue = flattenParameterGroup.genericValue(); + String odatavalue = flattenParameterGroup.odatavalue(); + SimpleProduct simpleBodyProduct = null; + if (description != null || genericValue != null || odatavalue != null) { + simpleBodyProduct = new SimpleProduct(); + simpleBodyProduct.withProductId(productId); + simpleBodyProduct.withDescription(description); + simpleBodyProduct.withMaxProductDisplayName(maxProductDisplayName); + simpleBodyProduct.withGenericValue(genericValue); + simpleBodyProduct.withOdatavalue(odatavalue); + } + return service.putSimpleProductWithGrouping(name, simpleBodyProduct) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putSimpleProductWithGroupingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putSimpleProductWithGroupingDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/modelflattening/implementation/package-info.java new file mode 100644 index 0000000000..6d5d7702d6 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestResourceFlatteningTestService. + * Resource Flattening for AutoRest. + */ +package fixtures.modelflattening.implementation; diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/BaseProduct.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/BaseProduct.java new file mode 100644 index 0000000000..256cfdd1c1 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/BaseProduct.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The product documentation. + */ +public class BaseProduct { + /** + * Unique identifier representing a specific product for a given latitude + * & longitude. For example, uberX in San Francisco will have a + * different product_id than uberX in Los Angeles. + */ + @JsonProperty(value = "base_product_id", required = true) + private String productId; + + /** + * Description of product. + */ + @JsonProperty(value = "base_product_description") + private String description; + + /** + * Get the productId value. + * + * @return the productId value + */ + public String productId() { + return this.productId; + } + + /** + * Set the productId value. + * + * @param productId the productId value to set + * @return the BaseProduct object itself. + */ + public BaseProduct withProductId(String productId) { + this.productId = productId; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the BaseProduct object itself. + */ + public BaseProduct withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/Error.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/Error.java new file mode 100644 index 0000000000..5aa64b8114 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/Error.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The parentError property. + */ + @JsonProperty(value = "parentError") + private Error parentError; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the parentError value. + * + * @return the parentError value + */ + public Error parentError() { + return this.parentError; + } + + /** + * Set the parentError value. + * + * @param parentError the parentError value to set + * @return the Error object itself. + */ + public Error withParentError(Error parentError) { + this.parentError = parentError; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/ErrorException.java new file mode 100644 index 0000000000..d77e9f616d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java new file mode 100644 index 0000000000..5a8ba11d32 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/FlattenParameterGroup.java @@ -0,0 +1,179 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Additional parameters for putSimpleProductWithGrouping operation. + */ +@JsonFlatten +public class FlattenParameterGroup { + /** + * Product name with value 'groupproduct'. + */ + @JsonProperty(value = "", required = true) + private String name; + + /** + * Unique identifier representing a specific product for a given latitude + * & longitude. For example, uberX in San Francisco will have a + * different product_id than uberX in Los Angeles. + */ + @JsonProperty(value = "", required = true) + private String productId; + + /** + * Description of product. + */ + @JsonProperty(value = "") + private String description; + + /** + * Display name of product. + */ + @JsonProperty(value = "", required = true) + private String maxProductDisplayName; + + /** + * Generic URL value. + */ + @JsonProperty(value = "") + private String genericValue; + + /** + * URL value. + */ + @JsonProperty(value = "") + private String odatavalue; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the FlattenParameterGroup object itself. + */ + public FlattenParameterGroup withName(String name) { + this.name = name; + return this; + } + + /** + * Get the productId value. + * + * @return the productId value + */ + public String productId() { + return this.productId; + } + + /** + * Set the productId value. + * + * @param productId the productId value to set + * @return the FlattenParameterGroup object itself. + */ + public FlattenParameterGroup withProductId(String productId) { + this.productId = productId; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the FlattenParameterGroup object itself. + */ + public FlattenParameterGroup withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the maxProductDisplayName value. + * + * @return the maxProductDisplayName value + */ + public String maxProductDisplayName() { + return this.maxProductDisplayName; + } + + /** + * Set the maxProductDisplayName value. + * + * @param maxProductDisplayName the maxProductDisplayName value to set + * @return the FlattenParameterGroup object itself. + */ + public FlattenParameterGroup withMaxProductDisplayName(String maxProductDisplayName) { + this.maxProductDisplayName = maxProductDisplayName; + return this; + } + + /** + * Get the genericValue value. + * + * @return the genericValue value + */ + public String genericValue() { + return this.genericValue; + } + + /** + * Set the genericValue value. + * + * @param genericValue the genericValue value to set + * @return the FlattenParameterGroup object itself. + */ + public FlattenParameterGroup withGenericValue(String genericValue) { + this.genericValue = genericValue; + return this; + } + + /** + * Get the odatavalue value. + * + * @return the odatavalue value + */ + public String odatavalue() { + return this.odatavalue; + } + + /** + * Set the odatavalue value. + * + * @param odatavalue the odatavalue value to set + * @return the FlattenParameterGroup object itself. + */ + public FlattenParameterGroup withOdatavalue(String odatavalue) { + this.odatavalue = odatavalue; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/FlattenedProduct.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/FlattenedProduct.java new file mode 100644 index 0000000000..dc4ad0b717 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/FlattenedProduct.java @@ -0,0 +1,116 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * Flattened product. + */ +@JsonFlatten +public class FlattenedProduct extends Resource { + /** + * The pname property. + */ + @JsonProperty(value = "properties.p\\.name") + private String pname; + + /** + * The flattenedProductType property. + */ + @JsonProperty(value = "properties.type") + private String flattenedProductType; + + /** + * Possible values include: 'Succeeded', 'Failed', 'canceled', 'Accepted', + * 'Creating', 'Created', 'Updating', 'Updated', 'Deleting', 'Deleted', + * 'OK'. + */ + @JsonProperty(value = "properties.provisioningStateValues", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningStateValues; + + /** + * The provisioningState property. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + + /** + * Get the pname value. + * + * @return the pname value + */ + public String pname() { + return this.pname; + } + + /** + * Set the pname value. + * + * @param pname the pname value to set + * @return the FlattenedProduct object itself. + */ + public FlattenedProduct withPname(String pname) { + this.pname = pname; + return this; + } + + /** + * Get the flattenedProductType value. + * + * @return the flattenedProductType value + */ + public String flattenedProductType() { + return this.flattenedProductType; + } + + /** + * Set the flattenedProductType value. + * + * @param flattenedProductType the flattenedProductType value to set + * @return the FlattenedProduct object itself. + */ + public FlattenedProduct withFlattenedProductType(String flattenedProductType) { + this.flattenedProductType = flattenedProductType; + return this; + } + + /** + * Get the provisioningStateValues value. + * + * @return the provisioningStateValues value + */ + public String provisioningStateValues() { + return this.provisioningStateValues; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the FlattenedProduct object itself. + */ + public FlattenedProduct withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/GenericUrl.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/GenericUrl.java new file mode 100644 index 0000000000..e35a803766 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/GenericUrl.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Generic URL. + */ +public class GenericUrl { + /** + * Generic URL value. + */ + @JsonProperty(value = "generic_value") + private String genericValue; + + /** + * Get the genericValue value. + * + * @return the genericValue value + */ + public String genericValue() { + return this.genericValue; + } + + /** + * Set the genericValue value. + * + * @param genericValue the genericValue value to set + * @return the GenericUrl object itself. + */ + public GenericUrl withGenericValue(String genericValue) { + this.genericValue = genericValue; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/ProductWrapper.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/ProductWrapper.java new file mode 100644 index 0000000000..5df49d05ef --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/ProductWrapper.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The wrapped produc. + */ +@JsonFlatten +public class ProductWrapper { + /** + * the product value. + */ + @JsonProperty(value = "property.value") + private String value; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ProductWrapper object itself. + */ + public ProductWrapper withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/Resource.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/Resource.java new file mode 100644 index 0000000000..f0278e77b2 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/Resource.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Resource model. + */ +public class Resource { + /** + * Resource Id. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * Resource Type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The tags property. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Resource Location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Resource Name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the Resource object itself. + */ + public Resource withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location value. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location value. + * + * @param location the location value to set + * @return the Resource object itself. + */ + public Resource withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/ResourceCollection.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/ResourceCollection.java new file mode 100644 index 0000000000..a6b30be0f5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/ResourceCollection.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ResourceCollection model. + */ +public class ResourceCollection { + /** + * The productresource property. + */ + @JsonProperty(value = "productresource") + private FlattenedProduct productresource; + + /** + * The arrayofresources property. + */ + @JsonProperty(value = "arrayofresources") + private List arrayofresources; + + /** + * The dictionaryofresources property. + */ + @JsonProperty(value = "dictionaryofresources") + private Map dictionaryofresources; + + /** + * Get the productresource value. + * + * @return the productresource value + */ + public FlattenedProduct productresource() { + return this.productresource; + } + + /** + * Set the productresource value. + * + * @param productresource the productresource value to set + * @return the ResourceCollection object itself. + */ + public ResourceCollection withProductresource(FlattenedProduct productresource) { + this.productresource = productresource; + return this; + } + + /** + * Get the arrayofresources value. + * + * @return the arrayofresources value + */ + public List arrayofresources() { + return this.arrayofresources; + } + + /** + * Set the arrayofresources value. + * + * @param arrayofresources the arrayofresources value to set + * @return the ResourceCollection object itself. + */ + public ResourceCollection withArrayofresources(List arrayofresources) { + this.arrayofresources = arrayofresources; + return this; + } + + /** + * Get the dictionaryofresources value. + * + * @return the dictionaryofresources value + */ + public Map dictionaryofresources() { + return this.dictionaryofresources; + } + + /** + * Set the dictionaryofresources value. + * + * @param dictionaryofresources the dictionaryofresources value to set + * @return the ResourceCollection object itself. + */ + public ResourceCollection withDictionaryofresources(Map dictionaryofresources) { + this.dictionaryofresources = dictionaryofresources; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/SimpleProduct.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/SimpleProduct.java new file mode 100644 index 0000000000..1075df8e33 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/SimpleProduct.java @@ -0,0 +1,132 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The product documentation. + */ +@JsonFlatten +public class SimpleProduct extends BaseProduct { + /** + * Display name of product. + */ + @JsonProperty(value = "details.max_product_display_name", required = true) + private String maxProductDisplayName; + + /** + * Capacity of product. For example, 4 people. + */ + @JsonProperty(value = "details.max_product_capacity", required = true) + private String capacity; + + /** + * Generic URL value. + */ + @JsonProperty(value = "details.max_product_image.generic_value") + private String genericValue; + + /** + * URL value. + */ + @JsonProperty(value = "details.max_product_image.@odata\\.value") + private String odatavalue; + + /** + * Creates an instance of SimpleProduct class. + */ + public SimpleProduct() { + capacity = "Large"; + } + + /** + * Get the maxProductDisplayName value. + * + * @return the maxProductDisplayName value + */ + public String maxProductDisplayName() { + return this.maxProductDisplayName; + } + + /** + * Set the maxProductDisplayName value. + * + * @param maxProductDisplayName the maxProductDisplayName value to set + * @return the SimpleProduct object itself. + */ + public SimpleProduct withMaxProductDisplayName(String maxProductDisplayName) { + this.maxProductDisplayName = maxProductDisplayName; + return this; + } + + /** + * Get the capacity value. + * + * @return the capacity value + */ + public String capacity() { + return this.capacity; + } + + /** + * Set the capacity value. + * + * @param capacity the capacity value to set + * @return the SimpleProduct object itself. + */ + public SimpleProduct withCapacity(String capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the genericValue value. + * + * @return the genericValue value + */ + public String genericValue() { + return this.genericValue; + } + + /** + * Set the genericValue value. + * + * @param genericValue the genericValue value to set + * @return the SimpleProduct object itself. + */ + public SimpleProduct withGenericValue(String genericValue) { + this.genericValue = genericValue; + return this; + } + + /** + * Get the odatavalue value. + * + * @return the odatavalue value + */ + public String odatavalue() { + return this.odatavalue; + } + + /** + * Set the odatavalue value. + * + * @param odatavalue the odatavalue value to set + * @return the SimpleProduct object itself. + */ + public SimpleProduct withOdatavalue(String odatavalue) { + this.odatavalue = odatavalue; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/WrappedProduct.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/WrappedProduct.java new file mode 100644 index 0000000000..976b0fa8e9 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/WrappedProduct.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.modelflattening.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The wrapped produc. + */ +public class WrappedProduct { + /** + * the product value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the WrappedProduct object itself. + */ + public WrappedProduct withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/models/package-info.java b/test/vanilla/src/main/java/fixtures/modelflattening/models/package-info.java new file mode 100644 index 0000000000..5fff1803d5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestResourceFlatteningTestService. + * Resource Flattening for AutoRest. + */ +package fixtures.modelflattening.models; diff --git a/test/vanilla/src/main/java/fixtures/modelflattening/package-info.java b/test/vanilla/src/main/java/fixtures/modelflattening/package-info.java new file mode 100644 index 0000000000..bfbb9b90d3 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/modelflattening/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestResourceFlatteningTestService. + * Resource Flattening for AutoRest. + */ +package fixtures.modelflattening; diff --git a/test/vanilla/src/main/java/fixtures/parameterflattening/AutoRestParameterFlattening.java b/test/vanilla/src/main/java/fixtures/parameterflattening/AutoRestParameterFlattening.java new file mode 100644 index 0000000000..4dbbf750e4 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/parameterflattening/AutoRestParameterFlattening.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.parameterflattening; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestParameterFlattening class. + */ +public interface AutoRestParameterFlattening { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets the AvailabilitySets object to access its operations. + * @return the AvailabilitySets object. + */ + AvailabilitySets availabilitySets(); + +} diff --git a/test/vanilla/src/main/java/fixtures/parameterflattening/AvailabilitySets.java b/test/vanilla/src/main/java/fixtures/parameterflattening/AvailabilitySets.java new file mode 100644 index 0000000000..2abe959d8d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/parameterflattening/AvailabilitySets.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.parameterflattening; + +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.Map; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailabilitySets. + */ +public interface AvailabilitySets { + /** + * Updates the tags for an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param avset The name of the storage availability set. + * @param tags A set of tags. A description about the set of tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void update(String resourceGroupName, String avset, Map tags); + + /** + * Updates the tags for an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param avset The name of the storage availability set. + * @param tags A set of tags. A description about the set of tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture updateAsync(String resourceGroupName, String avset, Map tags, final ServiceCallback serviceCallback); + + /** + * Updates the tags for an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param avset The name of the storage availability set. + * @param tags A set of tags. A description about the set of tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable updateAsync(String resourceGroupName, String avset, Map tags); + + /** + * Updates the tags for an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param avset The name of the storage availability set. + * @param tags A set of tags. A description about the set of tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> updateWithServiceResponseAsync(String resourceGroupName, String avset, Map tags); + +} diff --git a/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/AutoRestParameterFlatteningImpl.java b/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/AutoRestParameterFlatteningImpl.java new file mode 100644 index 0000000000..38256f28f9 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/AutoRestParameterFlatteningImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.parameterflattening.implementation; + +import fixtures.parameterflattening.AutoRestParameterFlattening; +import fixtures.parameterflattening.AvailabilitySets; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestParameterFlattening class. + */ +public class AutoRestParameterFlatteningImpl extends ServiceClient implements AutoRestParameterFlattening { + + /** + * The AvailabilitySets object to access its operations. + */ + private AvailabilitySets availabilitySets; + + /** + * Gets the AvailabilitySets object to access its operations. + * @return the AvailabilitySets object. + */ + public AvailabilitySets availabilitySets() { + return this.availabilitySets; + } + + /** + * Initializes an instance of AutoRestParameterFlattening client. + */ + public AutoRestParameterFlatteningImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestParameterFlattening client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestParameterFlatteningImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterFlattening client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestParameterFlatteningImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterFlattening client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestParameterFlatteningImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestParameterFlattening client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestParameterFlatteningImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.availabilitySets = new AvailabilitySetsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/AvailabilitySetsImpl.java b/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/AvailabilitySetsImpl.java new file mode 100644 index 0000000000..9fce56a4dd --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/AvailabilitySetsImpl.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.parameterflattening.implementation; + +import retrofit2.Retrofit; +import fixtures.parameterflattening.AvailabilitySets; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.parameterflattening.models.AvailabilitySetUpdateParameters; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AvailabilitySets. + */ +public class AvailabilitySetsImpl implements AvailabilitySets { + /** The Retrofit service to perform REST calls. */ + private AvailabilitySetsService service; + /** The service client containing this operation class. */ + private AutoRestParameterFlatteningImpl client; + + /** + * Initializes an instance of AvailabilitySets. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailabilitySetsImpl(Retrofit retrofit, AutoRestParameterFlatteningImpl client) { + this.service = retrofit.create(AvailabilitySetsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailabilitySets to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailabilitySetsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.parameterflattening.AvailabilitySets update" }) + @PATCH("parameterFlattening/{resourceGroupName}/{availabilitySetName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("availabilitySetName") String avset, @Body AvailabilitySetUpdateParameters tags); + + } + + /** + * Updates the tags for an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param avset The name of the storage availability set. + * @param tags A set of tags. A description about the set of tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void update(String resourceGroupName, String avset, Map tags) { + updateWithServiceResponseAsync(resourceGroupName, avset, tags).toBlocking().single().body(); + } + + /** + * Updates the tags for an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param avset The name of the storage availability set. + * @param tags A set of tags. A description about the set of tags. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String avset, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, avset, tags), serviceCallback); + } + + /** + * Updates the tags for an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param avset The name of the storage availability set. + * @param tags A set of tags. A description about the set of tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateAsync(String resourceGroupName, String avset, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, avset, tags).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates the tags for an availability set. + * + * @param resourceGroupName The name of the resource group. + * @param avset The name of the storage availability set. + * @param tags A set of tags. A description about the set of tags. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String avset, Map tags) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (avset == null) { + throw new IllegalArgumentException("Parameter avset is required and cannot be null."); + } + if (tags == null) { + throw new IllegalArgumentException("Parameter tags is required and cannot be null."); + } + Validator.validate(tags); + AvailabilitySetUpdateParameters tags1 = new AvailabilitySetUpdateParameters(); + tags1.withTags(tags); + return service.update(resourceGroupName, avset, tags1) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws RestException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/package-info.java new file mode 100644 index 0000000000..15d8f9f282 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/parameterflattening/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestParameterFlattening. + * Resource Flattening for AutoRest. + */ +package fixtures.parameterflattening.implementation; diff --git a/test/vanilla/src/main/java/fixtures/parameterflattening/models/AvailabilitySetUpdateParameters.java b/test/vanilla/src/main/java/fixtures/parameterflattening/models/AvailabilitySetUpdateParameters.java new file mode 100644 index 0000000000..a3b8d1ba34 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/parameterflattening/models/AvailabilitySetUpdateParameters.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.parameterflattening.models; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AvailabilitySetUpdateParameters model. + */ +public class AvailabilitySetUpdateParameters { + /** + * A set of tags. + * A description about the set of tags. + */ + @JsonProperty(value = "tags", required = true) + private Map tags; + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the AvailabilitySetUpdateParameters object itself. + */ + public AvailabilitySetUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/parameterflattening/models/package-info.java b/test/vanilla/src/main/java/fixtures/parameterflattening/models/package-info.java new file mode 100644 index 0000000000..2b7fea927e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/parameterflattening/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestParameterFlattening. + * Resource Flattening for AutoRest. + */ +package fixtures.parameterflattening.models; diff --git a/test/vanilla/src/main/java/fixtures/parameterflattening/package-info.java b/test/vanilla/src/main/java/fixtures/parameterflattening/package-info.java new file mode 100644 index 0000000000..8c4bc5b09d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/parameterflattening/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestParameterFlattening. + * Resource Flattening for AutoRest. + */ +package fixtures.parameterflattening; diff --git a/test/vanilla/src/main/java/fixtures/report/AutoRestReportService.java b/test/vanilla/src/main/java/fixtures/report/AutoRestReportService.java new file mode 100644 index 0000000000..4167afb261 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/report/AutoRestReportService.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.report; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.report.models.ErrorException; +import java.io.IOException; +import java.util.Map; +import rx.Observable; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestReportService class. + */ +public interface AutoRestReportService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + Map getReport(); + + /** + * Get test coverage report. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture> getReportAsync(final ServiceCallback> serviceCallback); + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable> getReportAsync(); + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + Observable>> getReportWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/report/implementation/AutoRestReportServiceImpl.java b/test/vanilla/src/main/java/fixtures/report/implementation/AutoRestReportServiceImpl.java new file mode 100644 index 0000000000..162f25c517 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/report/implementation/AutoRestReportServiceImpl.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.report.implementation; + +import fixtures.report.AutoRestReportService; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.report.models.ErrorException; +import java.io.IOException; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the AutoRestReportService class. + */ +public class AutoRestReportServiceImpl extends ServiceClient implements AutoRestReportService { + /** + * The Retrofit service to perform REST calls. + */ + private AutoRestReportServiceService service; + + /** + * Initializes an instance of AutoRestReportService client. + */ + public AutoRestReportServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestReportService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestReportServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestReportService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestReportServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestReportService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestReportServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestReportService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestReportServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + initializeService(); + } + + private void initializeService() { + service = retrofit().create(AutoRestReportServiceService.class); + } + + /** + * The interface defining all the services for AutoRestReportService to be + * used by Retrofit to perform actually REST calls. + */ + interface AutoRestReportServiceService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.report.AutoRestReportService getReport" }) + @GET("report") + Observable> getReport(); + + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Map<String, Integer> object if successful. + */ + public Map getReport() { + return getReportWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get test coverage report. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> getReportAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(getReportWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable> getReportAsync() { + return getReportWithServiceResponseAsync().map(new Func1>, Map>() { + @Override + public Map call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get test coverage report. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Map<String, Integer> object + */ + public Observable>> getReportWithServiceResponseAsync() { + return service.getReport() + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = getReportDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> getReportDelegate(Response response) throws ErrorException, IOException { + return this.restClient().responseBuilderFactory()., ErrorException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/report/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/report/implementation/package-info.java new file mode 100644 index 0000000000..28ef73f76a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/report/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestReportService. + * Test Infrastructure for AutoRest. + */ +package fixtures.report.implementation; diff --git a/test/vanilla/src/main/java/fixtures/report/models/Error.java b/test/vanilla/src/main/java/fixtures/report/models/Error.java new file mode 100644 index 0000000000..1b4b825d91 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/report/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.report.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/report/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/report/models/ErrorException.java new file mode 100644 index 0000000000..e798a8f127 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/report/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.report.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/report/models/package-info.java b/test/vanilla/src/main/java/fixtures/report/models/package-info.java new file mode 100644 index 0000000000..d64c93ef86 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/report/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestReportService. + * Test Infrastructure for AutoRest. + */ +package fixtures.report.models; diff --git a/test/vanilla/src/main/java/fixtures/report/package-info.java b/test/vanilla/src/main/java/fixtures/report/package-info.java new file mode 100644 index 0000000000..e85e0ec194 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/report/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestReportService. + * Test Infrastructure for AutoRest. + */ +package fixtures.report; diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/AutoRestRequiredOptionalTestService.java b/test/vanilla/src/main/java/fixtures/requiredoptional/AutoRestRequiredOptionalTestService.java new file mode 100644 index 0000000000..e83c3375df --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/AutoRestRequiredOptionalTestService.java @@ -0,0 +1,88 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestRequiredOptionalTestService class. + */ +public interface AutoRestRequiredOptionalTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets number of items to skip. + * + * @return the requiredGlobalPath value. + */ + String requiredGlobalPath(); + + /** + * Sets number of items to skip. + * + * @param requiredGlobalPath the requiredGlobalPath value. + * @return the service client itself + */ + AutoRestRequiredOptionalTestService withRequiredGlobalPath(String requiredGlobalPath); + + /** + * Gets number of items to skip. + * + * @return the requiredGlobalQuery value. + */ + String requiredGlobalQuery(); + + /** + * Sets number of items to skip. + * + * @param requiredGlobalQuery the requiredGlobalQuery value. + * @return the service client itself + */ + AutoRestRequiredOptionalTestService withRequiredGlobalQuery(String requiredGlobalQuery); + + /** + * Gets number of items to skip. + * + * @return the optionalGlobalQuery value. + */ + int optionalGlobalQuery(); + + /** + * Sets number of items to skip. + * + * @param optionalGlobalQuery the optionalGlobalQuery value. + * @return the service client itself + */ + AutoRestRequiredOptionalTestService withOptionalGlobalQuery(int optionalGlobalQuery); + + /** + * Gets the Implicits object to access its operations. + * @return the Implicits object. + */ + Implicits implicits(); + + /** + * Gets the Explicits object to access its operations. + * @return the Explicits object. + */ + Explicits explicits(); + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/Explicits.java b/test/vanilla/src/main/java/fixtures/requiredoptional/Explicits.java new file mode 100644 index 0000000000..95f76c558c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/Explicits.java @@ -0,0 +1,1246 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.requiredoptional.models.ArrayOptionalWrapper; +import fixtures.requiredoptional.models.ArrayWrapper; +import fixtures.requiredoptional.models.ClassOptionalWrapper; +import fixtures.requiredoptional.models.ClassWrapper; +import fixtures.requiredoptional.models.Error; +import fixtures.requiredoptional.models.ErrorException; +import fixtures.requiredoptional.models.IntOptionalWrapper; +import fixtures.requiredoptional.models.IntWrapper; +import fixtures.requiredoptional.models.Product; +import fixtures.requiredoptional.models.StringOptionalWrapper; +import fixtures.requiredoptional.models.StringWrapper; +import java.io.IOException; +import java.util.List; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Explicits. + */ +public interface Explicits { + /** + * Test explicitly required integer. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredIntegerParameter(int bodyParameter); + + /** + * Test explicitly required integer. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the int value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredIntegerParameterAsync(int bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required integer. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredIntegerParameterAsync(int bodyParameter); + + /** + * Test explicitly required integer. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredIntegerParameterWithServiceResponseAsync(int bodyParameter); + + /** + * Test explicitly optional integer. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalIntegerParameter(); + + /** + * Test explicitly optional integer. Please put null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalIntegerParameterAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalIntegerParameterAsync(); + + /** + * Test explicitly optional integer. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalIntegerParameterWithServiceResponseAsync(); + /** + * Test explicitly optional integer. Please put null. + * + * @param bodyParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalIntegerParameter(Integer bodyParameter); + + /** + * Test explicitly optional integer. Please put null. + * + * @param bodyParameter the Integer value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalIntegerParameterAsync(Integer bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put null. + * + * @param bodyParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalIntegerParameterAsync(Integer bodyParameter); + + /** + * Test explicitly optional integer. Please put null. + * + * @param bodyParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalIntegerParameterWithServiceResponseAsync(Integer bodyParameter); + + /** + * Test explicitly required integer. Please put a valid int-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the IntWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredIntegerProperty(IntWrapper bodyParameter); + + /** + * Test explicitly required integer. Please put a valid int-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the IntWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredIntegerPropertyAsync(IntWrapper bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required integer. Please put a valid int-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the IntWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredIntegerPropertyAsync(IntWrapper bodyParameter); + + /** + * Test explicitly required integer. Please put a valid int-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the IntWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredIntegerPropertyWithServiceResponseAsync(IntWrapper bodyParameter); + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalIntegerProperty(); + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalIntegerPropertyAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalIntegerPropertyAsync(); + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalIntegerPropertyWithServiceResponseAsync(); + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param bodyParameter the IntOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalIntegerProperty(IntOptionalWrapper bodyParameter); + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param bodyParameter the IntOptionalWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalIntegerPropertyAsync(IntOptionalWrapper bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param bodyParameter the IntOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalIntegerPropertyAsync(IntOptionalWrapper bodyParameter); + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param bodyParameter the IntOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalIntegerPropertyWithServiceResponseAsync(IntOptionalWrapper bodyParameter); + + /** + * Test explicitly required integer. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredIntegerHeader(int headerParameter); + + /** + * Test explicitly required integer. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the int value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredIntegerHeaderAsync(int headerParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required integer. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredIntegerHeaderAsync(int headerParameter); + + /** + * Test explicitly required integer. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredIntegerHeaderWithServiceResponseAsync(int headerParameter); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalIntegerHeader(); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalIntegerHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalIntegerHeaderAsync(); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalIntegerHeaderWithServiceResponseAsync(); + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalIntegerHeader(Integer headerParameter); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the Integer value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalIntegerHeaderAsync(Integer headerParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalIntegerHeaderAsync(Integer headerParameter); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalIntegerHeaderWithServiceResponseAsync(Integer headerParameter); + + /** + * Test explicitly required string. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredStringParameter(String bodyParameter); + + /** + * Test explicitly required string. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredStringParameterAsync(String bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required string. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredStringParameterAsync(String bodyParameter); + + /** + * Test explicitly required string. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredStringParameterWithServiceResponseAsync(String bodyParameter); + + /** + * Test explicitly optional string. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalStringParameter(); + + /** + * Test explicitly optional string. Please put null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalStringParameterAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional string. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalStringParameterAsync(); + + /** + * Test explicitly optional string. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalStringParameterWithServiceResponseAsync(); + /** + * Test explicitly optional string. Please put null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalStringParameter(String bodyParameter); + + /** + * Test explicitly optional string. Please put null. + * + * @param bodyParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalStringParameterAsync(String bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional string. Please put null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalStringParameterAsync(String bodyParameter); + + /** + * Test explicitly optional string. Please put null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalStringParameterWithServiceResponseAsync(String bodyParameter); + + /** + * Test explicitly required string. Please put a valid string-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the StringWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredStringProperty(StringWrapper bodyParameter); + + /** + * Test explicitly required string. Please put a valid string-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the StringWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredStringPropertyAsync(StringWrapper bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required string. Please put a valid string-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the StringWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredStringPropertyAsync(StringWrapper bodyParameter); + + /** + * Test explicitly required string. Please put a valid string-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the StringWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredStringPropertyWithServiceResponseAsync(StringWrapper bodyParameter); + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalStringProperty(); + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalStringPropertyAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalStringPropertyAsync(); + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalStringPropertyWithServiceResponseAsync(); + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param bodyParameter the StringOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalStringProperty(StringOptionalWrapper bodyParameter); + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param bodyParameter the StringOptionalWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalStringPropertyAsync(StringOptionalWrapper bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param bodyParameter the StringOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalStringPropertyAsync(StringOptionalWrapper bodyParameter); + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param bodyParameter the StringOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalStringPropertyWithServiceResponseAsync(StringOptionalWrapper bodyParameter); + + /** + * Test explicitly required string. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredStringHeader(String headerParameter); + + /** + * Test explicitly required string. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredStringHeaderAsync(String headerParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required string. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredStringHeaderAsync(String headerParameter); + + /** + * Test explicitly required string. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredStringHeaderWithServiceResponseAsync(String headerParameter); + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalStringHeader(); + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalStringHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalStringHeaderAsync(); + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalStringHeaderWithServiceResponseAsync(); + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalStringHeader(String bodyParameter); + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param bodyParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalStringHeaderAsync(String bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalStringHeaderAsync(String bodyParameter); + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalStringHeaderWithServiceResponseAsync(String bodyParameter); + + /** + * Test explicitly required complex object. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredClassParameter(Product bodyParameter); + + /** + * Test explicitly required complex object. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the Product value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredClassParameterAsync(Product bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required complex object. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredClassParameterAsync(Product bodyParameter); + + /** + * Test explicitly required complex object. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredClassParameterWithServiceResponseAsync(Product bodyParameter); + + /** + * Test explicitly optional complex object. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalClassParameter(); + + /** + * Test explicitly optional complex object. Please put null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalClassParameterAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional complex object. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalClassParameterAsync(); + + /** + * Test explicitly optional complex object. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalClassParameterWithServiceResponseAsync(); + /** + * Test explicitly optional complex object. Please put null. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalClassParameter(Product bodyParameter); + + /** + * Test explicitly optional complex object. Please put null. + * + * @param bodyParameter the Product value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalClassParameterAsync(Product bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional complex object. Please put null. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalClassParameterAsync(Product bodyParameter); + + /** + * Test explicitly optional complex object. Please put null. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalClassParameterWithServiceResponseAsync(Product bodyParameter); + + /** + * Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ClassWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredClassProperty(ClassWrapper bodyParameter); + + /** + * Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ClassWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredClassPropertyAsync(ClassWrapper bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ClassWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredClassPropertyAsync(ClassWrapper bodyParameter); + + /** + * Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ClassWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredClassPropertyWithServiceResponseAsync(ClassWrapper bodyParameter); + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalClassProperty(); + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalClassPropertyAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalClassPropertyAsync(); + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalClassPropertyWithServiceResponseAsync(); + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param bodyParameter the ClassOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalClassProperty(ClassOptionalWrapper bodyParameter); + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param bodyParameter the ClassOptionalWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalClassPropertyAsync(ClassOptionalWrapper bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param bodyParameter the ClassOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalClassPropertyAsync(ClassOptionalWrapper bodyParameter); + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param bodyParameter the ClassOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalClassPropertyWithServiceResponseAsync(ClassOptionalWrapper bodyParameter); + + /** + * Test explicitly required array. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredArrayParameter(List bodyParameter); + + /** + * Test explicitly required array. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredArrayParameterAsync(List bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required array. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredArrayParameterAsync(List bodyParameter); + + /** + * Test explicitly required array. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredArrayParameterWithServiceResponseAsync(List bodyParameter); + + /** + * Test explicitly optional array. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalArrayParameter(); + + /** + * Test explicitly optional array. Please put null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalArrayParameterAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional array. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalArrayParameterAsync(); + + /** + * Test explicitly optional array. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalArrayParameterWithServiceResponseAsync(); + /** + * Test explicitly optional array. Please put null. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalArrayParameter(List bodyParameter); + + /** + * Test explicitly optional array. Please put null. + * + * @param bodyParameter the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalArrayParameterAsync(List bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional array. Please put null. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalArrayParameterAsync(List bodyParameter); + + /** + * Test explicitly optional array. Please put null. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalArrayParameterWithServiceResponseAsync(List bodyParameter); + + /** + * Test explicitly required array. Please put a valid array-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ArrayWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredArrayProperty(ArrayWrapper bodyParameter); + + /** + * Test explicitly required array. Please put a valid array-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ArrayWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredArrayPropertyAsync(ArrayWrapper bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required array. Please put a valid array-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ArrayWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredArrayPropertyAsync(ArrayWrapper bodyParameter); + + /** + * Test explicitly required array. Please put a valid array-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ArrayWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredArrayPropertyWithServiceResponseAsync(ArrayWrapper bodyParameter); + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalArrayProperty(); + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalArrayPropertyAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalArrayPropertyAsync(); + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalArrayPropertyWithServiceResponseAsync(); + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param bodyParameter the ArrayOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalArrayProperty(ArrayOptionalWrapper bodyParameter); + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param bodyParameter the ArrayOptionalWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalArrayPropertyAsync(ArrayOptionalWrapper bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param bodyParameter the ArrayOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalArrayPropertyAsync(ArrayOptionalWrapper bodyParameter); + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param bodyParameter the ArrayOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalArrayPropertyWithServiceResponseAsync(ArrayOptionalWrapper bodyParameter); + + /** + * Test explicitly required array. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error postRequiredArrayHeader(List headerParameter); + + /** + * Test explicitly required array. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postRequiredArrayHeaderAsync(List headerParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly required array. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable postRequiredArrayHeaderAsync(List headerParameter); + + /** + * Test explicitly required array. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> postRequiredArrayHeaderWithServiceResponseAsync(List headerParameter); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalArrayHeader(); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalArrayHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalArrayHeaderAsync(); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalArrayHeaderWithServiceResponseAsync(); + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void postOptionalArrayHeader(List headerParameter); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postOptionalArrayHeaderAsync(List headerParameter, final ServiceCallback serviceCallback); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable postOptionalArrayHeaderAsync(List headerParameter); + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> postOptionalArrayHeaderWithServiceResponseAsync(List headerParameter); + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/Implicits.java b/test/vanilla/src/main/java/fixtures/requiredoptional/Implicits.java new file mode 100644 index 0000000000..1e6d25b342 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/Implicits.java @@ -0,0 +1,383 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.requiredoptional.models.Error; +import fixtures.requiredoptional.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Implicits. + */ +public interface Implicits { + /** + * Test implicitly required path parameter. + * + * @param pathParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error getRequiredPath(String pathParameter); + + /** + * Test implicitly required path parameter. + * + * @param pathParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getRequiredPathAsync(String pathParameter, final ServiceCallback serviceCallback); + + /** + * Test implicitly required path parameter. + * + * @param pathParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable getRequiredPathAsync(String pathParameter); + + /** + * Test implicitly required path parameter. + * + * @param pathParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> getRequiredPathWithServiceResponseAsync(String pathParameter); + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putOptionalQuery(); + + /** + * Test implicitly optional query parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putOptionalQueryAsync(final ServiceCallback serviceCallback); + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putOptionalQueryAsync(); + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putOptionalQueryWithServiceResponseAsync(); + /** + * Test implicitly optional query parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putOptionalQuery(String queryParameter); + + /** + * Test implicitly optional query parameter. + * + * @param queryParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putOptionalQueryAsync(String queryParameter, final ServiceCallback serviceCallback); + + /** + * Test implicitly optional query parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putOptionalQueryAsync(String queryParameter); + + /** + * Test implicitly optional query parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putOptionalQueryWithServiceResponseAsync(String queryParameter); + + /** + * Test implicitly optional header parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putOptionalHeader(); + + /** + * Test implicitly optional header parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putOptionalHeaderAsync(final ServiceCallback serviceCallback); + + /** + * Test implicitly optional header parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putOptionalHeaderAsync(); + + /** + * Test implicitly optional header parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putOptionalHeaderWithServiceResponseAsync(); + /** + * Test implicitly optional header parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putOptionalHeader(String queryParameter); + + /** + * Test implicitly optional header parameter. + * + * @param queryParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putOptionalHeaderAsync(String queryParameter, final ServiceCallback serviceCallback); + + /** + * Test implicitly optional header parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putOptionalHeaderAsync(String queryParameter); + + /** + * Test implicitly optional header parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putOptionalHeaderWithServiceResponseAsync(String queryParameter); + + /** + * Test implicitly optional body parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putOptionalBody(); + + /** + * Test implicitly optional body parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putOptionalBodyAsync(final ServiceCallback serviceCallback); + + /** + * Test implicitly optional body parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putOptionalBodyAsync(); + + /** + * Test implicitly optional body parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putOptionalBodyWithServiceResponseAsync(); + /** + * Test implicitly optional body parameter. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void putOptionalBody(String bodyParameter); + + /** + * Test implicitly optional body parameter. + * + * @param bodyParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture putOptionalBodyAsync(String bodyParameter, final ServiceCallback serviceCallback); + + /** + * Test implicitly optional body parameter. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable putOptionalBodyAsync(String bodyParameter); + + /** + * Test implicitly optional body parameter. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> putOptionalBodyWithServiceResponseAsync(String bodyParameter); + + /** + * Test implicitly required path parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error getRequiredGlobalPath(); + + /** + * Test implicitly required path parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getRequiredGlobalPathAsync(final ServiceCallback serviceCallback); + + /** + * Test implicitly required path parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable getRequiredGlobalPathAsync(); + + /** + * Test implicitly required path parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> getRequiredGlobalPathWithServiceResponseAsync(); + + /** + * Test implicitly required query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error getRequiredGlobalQuery(); + + /** + * Test implicitly required query parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getRequiredGlobalQueryAsync(final ServiceCallback serviceCallback); + + /** + * Test implicitly required query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable getRequiredGlobalQueryAsync(); + + /** + * Test implicitly required query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> getRequiredGlobalQueryWithServiceResponseAsync(); + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + Error getOptionalGlobalQuery(); + + /** + * Test implicitly optional query parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getOptionalGlobalQueryAsync(final ServiceCallback serviceCallback); + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable getOptionalGlobalQueryAsync(); + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + Observable> getOptionalGlobalQueryWithServiceResponseAsync(); + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/AutoRestRequiredOptionalTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/AutoRestRequiredOptionalTestServiceImpl.java new file mode 100644 index 0000000000..94b7d541ce --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/AutoRestRequiredOptionalTestServiceImpl.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.implementation; + +import fixtures.requiredoptional.AutoRestRequiredOptionalTestService; +import fixtures.requiredoptional.Implicits; +import fixtures.requiredoptional.Explicits; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestRequiredOptionalTestService class. + */ +public class AutoRestRequiredOptionalTestServiceImpl extends ServiceClient implements AutoRestRequiredOptionalTestService { + + /** number of items to skip. */ + private String requiredGlobalPath; + + /** + * Gets number of items to skip. + * + * @return the requiredGlobalPath value. + */ + public String requiredGlobalPath() { + return this.requiredGlobalPath; + } + + /** + * Sets number of items to skip. + * + * @param requiredGlobalPath the requiredGlobalPath value. + * @return the service client itself + */ + public AutoRestRequiredOptionalTestServiceImpl withRequiredGlobalPath(String requiredGlobalPath) { + this.requiredGlobalPath = requiredGlobalPath; + return this; + } + + /** number of items to skip. */ + private String requiredGlobalQuery; + + /** + * Gets number of items to skip. + * + * @return the requiredGlobalQuery value. + */ + public String requiredGlobalQuery() { + return this.requiredGlobalQuery; + } + + /** + * Sets number of items to skip. + * + * @param requiredGlobalQuery the requiredGlobalQuery value. + * @return the service client itself + */ + public AutoRestRequiredOptionalTestServiceImpl withRequiredGlobalQuery(String requiredGlobalQuery) { + this.requiredGlobalQuery = requiredGlobalQuery; + return this; + } + + /** number of items to skip. */ + private int optionalGlobalQuery; + + /** + * Gets number of items to skip. + * + * @return the optionalGlobalQuery value. + */ + public int optionalGlobalQuery() { + return this.optionalGlobalQuery; + } + + /** + * Sets number of items to skip. + * + * @param optionalGlobalQuery the optionalGlobalQuery value. + * @return the service client itself + */ + public AutoRestRequiredOptionalTestServiceImpl withOptionalGlobalQuery(int optionalGlobalQuery) { + this.optionalGlobalQuery = optionalGlobalQuery; + return this; + } + + /** + * The Implicits object to access its operations. + */ + private Implicits implicits; + + /** + * Gets the Implicits object to access its operations. + * @return the Implicits object. + */ + public Implicits implicits() { + return this.implicits; + } + + /** + * The Explicits object to access its operations. + */ + private Explicits explicits; + + /** + * Gets the Explicits object to access its operations. + * @return the Explicits object. + */ + public Explicits explicits() { + return this.explicits; + } + + /** + * Initializes an instance of AutoRestRequiredOptionalTestService client. + */ + public AutoRestRequiredOptionalTestServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestRequiredOptionalTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestRequiredOptionalTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestRequiredOptionalTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestRequiredOptionalTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestRequiredOptionalTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestRequiredOptionalTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestRequiredOptionalTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestRequiredOptionalTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.implicits = new ImplicitsImpl(retrofit(), this); + this.explicits = new ExplicitsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/ExplicitsImpl.java b/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/ExplicitsImpl.java new file mode 100644 index 0000000000..24a6b6fe81 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/ExplicitsImpl.java @@ -0,0 +1,2370 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.implementation; + +import retrofit2.Retrofit; +import fixtures.requiredoptional.Explicits; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.requiredoptional.models.ArrayOptionalWrapper; +import fixtures.requiredoptional.models.ArrayWrapper; +import fixtures.requiredoptional.models.ClassOptionalWrapper; +import fixtures.requiredoptional.models.ClassWrapper; +import fixtures.requiredoptional.models.Error; +import fixtures.requiredoptional.models.ErrorException; +import fixtures.requiredoptional.models.IntOptionalWrapper; +import fixtures.requiredoptional.models.IntWrapper; +import fixtures.requiredoptional.models.Product; +import fixtures.requiredoptional.models.StringOptionalWrapper; +import fixtures.requiredoptional.models.StringWrapper; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.POST; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Explicits. + */ +public class ExplicitsImpl implements Explicits { + /** The Retrofit service to perform REST calls. */ + private ExplicitsService service; + /** The service client containing this operation class. */ + private AutoRestRequiredOptionalTestServiceImpl client; + + /** + * Initializes an instance of Explicits. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ExplicitsImpl(Retrofit retrofit, AutoRestRequiredOptionalTestServiceImpl client) { + this.service = retrofit.create(ExplicitsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Explicits to be + * used by Retrofit to perform actually REST calls. + */ + interface ExplicitsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredIntegerParameter" }) + @POST("reqopt/requied/integer/parameter") + Observable> postRequiredIntegerParameter(@Body int bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalIntegerParameter" }) + @POST("reqopt/optional/integer/parameter") + Observable> postOptionalIntegerParameter(@Body Integer bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredIntegerProperty" }) + @POST("reqopt/requied/integer/property") + Observable> postRequiredIntegerProperty(@Body IntWrapper bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalIntegerProperty" }) + @POST("reqopt/optional/integer/property") + Observable> postOptionalIntegerProperty(@Body IntOptionalWrapper bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredIntegerHeader" }) + @POST("reqopt/requied/integer/header") + Observable> postRequiredIntegerHeader(@Header("headerParameter") int headerParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalIntegerHeader" }) + @POST("reqopt/optional/integer/header") + Observable> postOptionalIntegerHeader(@Header("headerParameter") Integer headerParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredStringParameter" }) + @POST("reqopt/requied/string/parameter") + Observable> postRequiredStringParameter(@Body String bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalStringParameter" }) + @POST("reqopt/optional/string/parameter") + Observable> postOptionalStringParameter(@Body String bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredStringProperty" }) + @POST("reqopt/requied/string/property") + Observable> postRequiredStringProperty(@Body StringWrapper bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalStringProperty" }) + @POST("reqopt/optional/string/property") + Observable> postOptionalStringProperty(@Body StringOptionalWrapper bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredStringHeader" }) + @POST("reqopt/requied/string/header") + Observable> postRequiredStringHeader(@Header("headerParameter") String headerParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalStringHeader" }) + @POST("reqopt/optional/string/header") + Observable> postOptionalStringHeader(@Header("bodyParameter") String bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredClassParameter" }) + @POST("reqopt/requied/class/parameter") + Observable> postRequiredClassParameter(@Body Product bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalClassParameter" }) + @POST("reqopt/optional/class/parameter") + Observable> postOptionalClassParameter(@Body Product bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredClassProperty" }) + @POST("reqopt/requied/class/property") + Observable> postRequiredClassProperty(@Body ClassWrapper bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalClassProperty" }) + @POST("reqopt/optional/class/property") + Observable> postOptionalClassProperty(@Body ClassOptionalWrapper bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredArrayParameter" }) + @POST("reqopt/requied/array/parameter") + Observable> postRequiredArrayParameter(@Body List bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalArrayParameter" }) + @POST("reqopt/optional/array/parameter") + Observable> postOptionalArrayParameter(@Body List bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredArrayProperty" }) + @POST("reqopt/requied/array/property") + Observable> postRequiredArrayProperty(@Body ArrayWrapper bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalArrayProperty" }) + @POST("reqopt/optional/array/property") + Observable> postOptionalArrayProperty(@Body ArrayOptionalWrapper bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postRequiredArrayHeader" }) + @POST("reqopt/requied/array/header") + Observable> postRequiredArrayHeader(@Header("headerParameter") String headerParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Explicits postOptionalArrayHeader" }) + @POST("reqopt/optional/array/header") + Observable> postOptionalArrayHeader(@Header("headerParameter") String headerParameter); + + } + + /** + * Test explicitly required integer. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredIntegerParameter(int bodyParameter) { + return postRequiredIntegerParameterWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required integer. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the int value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredIntegerParameterAsync(int bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredIntegerParameterWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly required integer. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredIntegerParameterAsync(int bodyParameter) { + return postRequiredIntegerParameterWithServiceResponseAsync(bodyParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required integer. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredIntegerParameterWithServiceResponseAsync(int bodyParameter) { + return service.postRequiredIntegerParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredIntegerParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredIntegerParameterDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional integer. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalIntegerParameter() { + postOptionalIntegerParameterWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalIntegerParameterAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalIntegerParameterWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalIntegerParameterAsync() { + return postOptionalIntegerParameterWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalIntegerParameterWithServiceResponseAsync() { + final Integer bodyParameter = null; + return service.postOptionalIntegerParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalIntegerParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional integer. Please put null. + * + * @param bodyParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalIntegerParameter(Integer bodyParameter) { + postOptionalIntegerParameterWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put null. + * + * @param bodyParameter the Integer value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalIntegerParameterAsync(Integer bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalIntegerParameterWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put null. + * + * @param bodyParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalIntegerParameterAsync(Integer bodyParameter) { + return postOptionalIntegerParameterWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put null. + * + * @param bodyParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalIntegerParameterWithServiceResponseAsync(Integer bodyParameter) { + return service.postOptionalIntegerParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalIntegerParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalIntegerParameterDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required integer. Please put a valid int-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the IntWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredIntegerProperty(IntWrapper bodyParameter) { + return postRequiredIntegerPropertyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required integer. Please put a valid int-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the IntWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredIntegerPropertyAsync(IntWrapper bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredIntegerPropertyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly required integer. Please put a valid int-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the IntWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredIntegerPropertyAsync(IntWrapper bodyParameter) { + return postRequiredIntegerPropertyWithServiceResponseAsync(bodyParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required integer. Please put a valid int-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the IntWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredIntegerPropertyWithServiceResponseAsync(IntWrapper bodyParameter) { + if (bodyParameter == null) { + throw new IllegalArgumentException("Parameter bodyParameter is required and cannot be null."); + } + Validator.validate(bodyParameter); + return service.postRequiredIntegerProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredIntegerPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredIntegerPropertyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalIntegerProperty() { + postOptionalIntegerPropertyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalIntegerPropertyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalIntegerPropertyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalIntegerPropertyAsync() { + return postOptionalIntegerPropertyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalIntegerPropertyWithServiceResponseAsync() { + final IntOptionalWrapper bodyParameter = null; + return service.postOptionalIntegerProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalIntegerPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param bodyParameter the IntOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalIntegerProperty(IntOptionalWrapper bodyParameter) { + postOptionalIntegerPropertyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param bodyParameter the IntOptionalWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalIntegerPropertyAsync(IntOptionalWrapper bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalIntegerPropertyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param bodyParameter the IntOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalIntegerPropertyAsync(IntOptionalWrapper bodyParameter) { + return postOptionalIntegerPropertyWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put a valid int-wrapper with 'value' = null. + * + * @param bodyParameter the IntOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalIntegerPropertyWithServiceResponseAsync(IntOptionalWrapper bodyParameter) { + Validator.validate(bodyParameter); + return service.postOptionalIntegerProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalIntegerPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalIntegerPropertyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required integer. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredIntegerHeader(int headerParameter) { + return postRequiredIntegerHeaderWithServiceResponseAsync(headerParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required integer. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the int value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredIntegerHeaderAsync(int headerParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredIntegerHeaderWithServiceResponseAsync(headerParameter), serviceCallback); + } + + /** + * Test explicitly required integer. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredIntegerHeaderAsync(int headerParameter) { + return postRequiredIntegerHeaderWithServiceResponseAsync(headerParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required integer. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the int value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredIntegerHeaderWithServiceResponseAsync(int headerParameter) { + return service.postRequiredIntegerHeader(headerParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredIntegerHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredIntegerHeaderDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalIntegerHeader() { + postOptionalIntegerHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalIntegerHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalIntegerHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalIntegerHeaderAsync() { + return postOptionalIntegerHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalIntegerHeaderWithServiceResponseAsync() { + final Integer headerParameter = null; + return service.postOptionalIntegerHeader(headerParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalIntegerHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalIntegerHeader(Integer headerParameter) { + postOptionalIntegerHeaderWithServiceResponseAsync(headerParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the Integer value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalIntegerHeaderAsync(Integer headerParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalIntegerHeaderWithServiceResponseAsync(headerParameter), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalIntegerHeaderAsync(Integer headerParameter) { + return postOptionalIntegerHeaderWithServiceResponseAsync(headerParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the Integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalIntegerHeaderWithServiceResponseAsync(Integer headerParameter) { + return service.postOptionalIntegerHeader(headerParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalIntegerHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalIntegerHeaderDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required string. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredStringParameter(String bodyParameter) { + return postRequiredStringParameterWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required string. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredStringParameterAsync(String bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredStringParameterWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly required string. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredStringParameterAsync(String bodyParameter) { + return postRequiredStringParameterWithServiceResponseAsync(bodyParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required string. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredStringParameterWithServiceResponseAsync(String bodyParameter) { + if (bodyParameter == null) { + throw new IllegalArgumentException("Parameter bodyParameter is required and cannot be null."); + } + return service.postRequiredStringParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredStringParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredStringParameterDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional string. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalStringParameter() { + postOptionalStringParameterWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional string. Please put null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalStringParameterAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalStringParameterWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional string. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalStringParameterAsync() { + return postOptionalStringParameterWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional string. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalStringParameterWithServiceResponseAsync() { + final String bodyParameter = null; + return service.postOptionalStringParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalStringParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional string. Please put null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalStringParameter(String bodyParameter) { + postOptionalStringParameterWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional string. Please put null. + * + * @param bodyParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalStringParameterAsync(String bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalStringParameterWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional string. Please put null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalStringParameterAsync(String bodyParameter) { + return postOptionalStringParameterWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional string. Please put null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalStringParameterWithServiceResponseAsync(String bodyParameter) { + return service.postOptionalStringParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalStringParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalStringParameterDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required string. Please put a valid string-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the StringWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredStringProperty(StringWrapper bodyParameter) { + return postRequiredStringPropertyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required string. Please put a valid string-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the StringWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredStringPropertyAsync(StringWrapper bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredStringPropertyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly required string. Please put a valid string-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the StringWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredStringPropertyAsync(StringWrapper bodyParameter) { + return postRequiredStringPropertyWithServiceResponseAsync(bodyParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required string. Please put a valid string-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the StringWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredStringPropertyWithServiceResponseAsync(StringWrapper bodyParameter) { + if (bodyParameter == null) { + throw new IllegalArgumentException("Parameter bodyParameter is required and cannot be null."); + } + Validator.validate(bodyParameter); + return service.postRequiredStringProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredStringPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredStringPropertyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalStringProperty() { + postOptionalStringPropertyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalStringPropertyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalStringPropertyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalStringPropertyAsync() { + return postOptionalStringPropertyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalStringPropertyWithServiceResponseAsync() { + final StringOptionalWrapper bodyParameter = null; + return service.postOptionalStringProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalStringPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param bodyParameter the StringOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalStringProperty(StringOptionalWrapper bodyParameter) { + postOptionalStringPropertyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param bodyParameter the StringOptionalWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalStringPropertyAsync(StringOptionalWrapper bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalStringPropertyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param bodyParameter the StringOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalStringPropertyAsync(StringOptionalWrapper bodyParameter) { + return postOptionalStringPropertyWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put a valid string-wrapper with 'value' = null. + * + * @param bodyParameter the StringOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalStringPropertyWithServiceResponseAsync(StringOptionalWrapper bodyParameter) { + Validator.validate(bodyParameter); + return service.postOptionalStringProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalStringPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalStringPropertyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required string. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredStringHeader(String headerParameter) { + return postRequiredStringHeaderWithServiceResponseAsync(headerParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required string. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredStringHeaderAsync(String headerParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredStringHeaderWithServiceResponseAsync(headerParameter), serviceCallback); + } + + /** + * Test explicitly required string. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredStringHeaderAsync(String headerParameter) { + return postRequiredStringHeaderWithServiceResponseAsync(headerParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required string. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredStringHeaderWithServiceResponseAsync(String headerParameter) { + if (headerParameter == null) { + throw new IllegalArgumentException("Parameter headerParameter is required and cannot be null."); + } + return service.postRequiredStringHeader(headerParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredStringHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredStringHeaderDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalStringHeader() { + postOptionalStringHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalStringHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalStringHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalStringHeaderAsync() { + return postOptionalStringHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalStringHeaderWithServiceResponseAsync() { + final String bodyParameter = null; + return service.postOptionalStringHeader(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalStringHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalStringHeader(String bodyParameter) { + postOptionalStringHeaderWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param bodyParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalStringHeaderAsync(String bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalStringHeaderWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalStringHeaderAsync(String bodyParameter) { + return postOptionalStringHeaderWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional string. Please put a header 'headerParameter' => null. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalStringHeaderWithServiceResponseAsync(String bodyParameter) { + return service.postOptionalStringHeader(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalStringHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalStringHeaderDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required complex object. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredClassParameter(Product bodyParameter) { + return postRequiredClassParameterWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required complex object. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the Product value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredClassParameterAsync(Product bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredClassParameterWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly required complex object. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredClassParameterAsync(Product bodyParameter) { + return postRequiredClassParameterWithServiceResponseAsync(bodyParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required complex object. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredClassParameterWithServiceResponseAsync(Product bodyParameter) { + if (bodyParameter == null) { + throw new IllegalArgumentException("Parameter bodyParameter is required and cannot be null."); + } + Validator.validate(bodyParameter); + return service.postRequiredClassParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredClassParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredClassParameterDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional complex object. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalClassParameter() { + postOptionalClassParameterWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional complex object. Please put null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalClassParameterAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalClassParameterWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional complex object. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalClassParameterAsync() { + return postOptionalClassParameterWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional complex object. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalClassParameterWithServiceResponseAsync() { + final Product bodyParameter = null; + return service.postOptionalClassParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalClassParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional complex object. Please put null. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalClassParameter(Product bodyParameter) { + postOptionalClassParameterWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional complex object. Please put null. + * + * @param bodyParameter the Product value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalClassParameterAsync(Product bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalClassParameterWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional complex object. Please put null. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalClassParameterAsync(Product bodyParameter) { + return postOptionalClassParameterWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional complex object. Please put null. + * + * @param bodyParameter the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalClassParameterWithServiceResponseAsync(Product bodyParameter) { + Validator.validate(bodyParameter); + return service.postOptionalClassParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalClassParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalClassParameterDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ClassWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredClassProperty(ClassWrapper bodyParameter) { + return postRequiredClassPropertyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ClassWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredClassPropertyAsync(ClassWrapper bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredClassPropertyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ClassWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredClassPropertyAsync(ClassWrapper bodyParameter) { + return postRequiredClassPropertyWithServiceResponseAsync(bodyParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required complex object. Please put a valid class-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ClassWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredClassPropertyWithServiceResponseAsync(ClassWrapper bodyParameter) { + if (bodyParameter == null) { + throw new IllegalArgumentException("Parameter bodyParameter is required and cannot be null."); + } + Validator.validate(bodyParameter); + return service.postRequiredClassProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredClassPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredClassPropertyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalClassProperty() { + postOptionalClassPropertyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalClassPropertyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalClassPropertyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalClassPropertyAsync() { + return postOptionalClassPropertyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalClassPropertyWithServiceResponseAsync() { + final ClassOptionalWrapper bodyParameter = null; + return service.postOptionalClassProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalClassPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param bodyParameter the ClassOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalClassProperty(ClassOptionalWrapper bodyParameter) { + postOptionalClassPropertyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param bodyParameter the ClassOptionalWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalClassPropertyAsync(ClassOptionalWrapper bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalClassPropertyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param bodyParameter the ClassOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalClassPropertyAsync(ClassOptionalWrapper bodyParameter) { + return postOptionalClassPropertyWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional complex object. Please put a valid class-wrapper with 'value' = null. + * + * @param bodyParameter the ClassOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalClassPropertyWithServiceResponseAsync(ClassOptionalWrapper bodyParameter) { + Validator.validate(bodyParameter); + return service.postOptionalClassProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalClassPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalClassPropertyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required array. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredArrayParameter(List bodyParameter) { + return postRequiredArrayParameterWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required array. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredArrayParameterAsync(List bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredArrayParameterWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly required array. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredArrayParameterAsync(List bodyParameter) { + return postRequiredArrayParameterWithServiceResponseAsync(bodyParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required array. Please put null and the client library should throw before the request is sent. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredArrayParameterWithServiceResponseAsync(List bodyParameter) { + if (bodyParameter == null) { + throw new IllegalArgumentException("Parameter bodyParameter is required and cannot be null."); + } + Validator.validate(bodyParameter); + return service.postRequiredArrayParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredArrayParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredArrayParameterDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional array. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalArrayParameter() { + postOptionalArrayParameterWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional array. Please put null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalArrayParameterAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalArrayParameterWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional array. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalArrayParameterAsync() { + return postOptionalArrayParameterWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional array. Please put null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalArrayParameterWithServiceResponseAsync() { + final List bodyParameter = null; + return service.postOptionalArrayParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalArrayParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional array. Please put null. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalArrayParameter(List bodyParameter) { + postOptionalArrayParameterWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional array. Please put null. + * + * @param bodyParameter the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalArrayParameterAsync(List bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalArrayParameterWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional array. Please put null. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalArrayParameterAsync(List bodyParameter) { + return postOptionalArrayParameterWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional array. Please put null. + * + * @param bodyParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalArrayParameterWithServiceResponseAsync(List bodyParameter) { + Validator.validate(bodyParameter); + return service.postOptionalArrayParameter(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalArrayParameterDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalArrayParameterDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required array. Please put a valid array-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ArrayWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredArrayProperty(ArrayWrapper bodyParameter) { + return postRequiredArrayPropertyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required array. Please put a valid array-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ArrayWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredArrayPropertyAsync(ArrayWrapper bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredArrayPropertyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly required array. Please put a valid array-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ArrayWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredArrayPropertyAsync(ArrayWrapper bodyParameter) { + return postRequiredArrayPropertyWithServiceResponseAsync(bodyParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required array. Please put a valid array-wrapper with 'value' = null and the client library should throw before the request is sent. + * + * @param bodyParameter the ArrayWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredArrayPropertyWithServiceResponseAsync(ArrayWrapper bodyParameter) { + if (bodyParameter == null) { + throw new IllegalArgumentException("Parameter bodyParameter is required and cannot be null."); + } + Validator.validate(bodyParameter); + return service.postRequiredArrayProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredArrayPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredArrayPropertyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalArrayProperty() { + postOptionalArrayPropertyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalArrayPropertyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalArrayPropertyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalArrayPropertyAsync() { + return postOptionalArrayPropertyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalArrayPropertyWithServiceResponseAsync() { + final ArrayOptionalWrapper bodyParameter = null; + return service.postOptionalArrayProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalArrayPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param bodyParameter the ArrayOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalArrayProperty(ArrayOptionalWrapper bodyParameter) { + postOptionalArrayPropertyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param bodyParameter the ArrayOptionalWrapper value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalArrayPropertyAsync(ArrayOptionalWrapper bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalArrayPropertyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param bodyParameter the ArrayOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalArrayPropertyAsync(ArrayOptionalWrapper bodyParameter) { + return postOptionalArrayPropertyWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional array. Please put a valid array-wrapper with 'value' = null. + * + * @param bodyParameter the ArrayOptionalWrapper value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalArrayPropertyWithServiceResponseAsync(ArrayOptionalWrapper bodyParameter) { + Validator.validate(bodyParameter); + return service.postOptionalArrayProperty(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalArrayPropertyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalArrayPropertyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly required array. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error postRequiredArrayHeader(List headerParameter) { + return postRequiredArrayHeaderWithServiceResponseAsync(headerParameter).toBlocking().single().body(); + } + + /** + * Test explicitly required array. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postRequiredArrayHeaderAsync(List headerParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postRequiredArrayHeaderWithServiceResponseAsync(headerParameter), serviceCallback); + } + + /** + * Test explicitly required array. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable postRequiredArrayHeaderAsync(List headerParameter) { + return postRequiredArrayHeaderWithServiceResponseAsync(headerParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly required array. Please put a header 'headerParameter' => null and the client library should throw before the request is sent. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> postRequiredArrayHeaderWithServiceResponseAsync(List headerParameter) { + if (headerParameter == null) { + throw new IllegalArgumentException("Parameter headerParameter is required and cannot be null."); + } + Validator.validate(headerParameter); + String headerParameterConverted = this.client.serializerAdapter().serializeList(headerParameter, CollectionFormat.CSV); + return service.postRequiredArrayHeader(headerParameterConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postRequiredArrayHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postRequiredArrayHeaderDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalArrayHeader() { + postOptionalArrayHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalArrayHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalArrayHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalArrayHeaderAsync() { + return postOptionalArrayHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalArrayHeaderWithServiceResponseAsync() { + final List headerParameter = null; + String headerParameterConverted = this.client.serializerAdapter().serializeList(headerParameter, CollectionFormat.CSV); + return service.postOptionalArrayHeader(headerParameterConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalArrayHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void postOptionalArrayHeader(List headerParameter) { + postOptionalArrayHeaderWithServiceResponseAsync(headerParameter).toBlocking().single().body(); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the List<String> value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postOptionalArrayHeaderAsync(List headerParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postOptionalArrayHeaderWithServiceResponseAsync(headerParameter), serviceCallback); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable postOptionalArrayHeaderAsync(List headerParameter) { + return postOptionalArrayHeaderWithServiceResponseAsync(headerParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test explicitly optional integer. Please put a header 'headerParameter' => null. + * + * @param headerParameter the List<String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> postOptionalArrayHeaderWithServiceResponseAsync(List headerParameter) { + Validator.validate(headerParameter); + String headerParameterConverted = this.client.serializerAdapter().serializeList(headerParameter, CollectionFormat.CSV); + return service.postOptionalArrayHeader(headerParameterConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postOptionalArrayHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postOptionalArrayHeaderDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/ImplicitsImpl.java b/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/ImplicitsImpl.java new file mode 100644 index 0000000000..cac20af74d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/ImplicitsImpl.java @@ -0,0 +1,747 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.implementation; + +import retrofit2.Retrofit; +import fixtures.requiredoptional.Implicits; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.requiredoptional.models.Error; +import fixtures.requiredoptional.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Implicits. + */ +public class ImplicitsImpl implements Implicits { + /** The Retrofit service to perform REST calls. */ + private ImplicitsService service; + /** The service client containing this operation class. */ + private AutoRestRequiredOptionalTestServiceImpl client; + + /** + * Initializes an instance of Implicits. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ImplicitsImpl(Retrofit retrofit, AutoRestRequiredOptionalTestServiceImpl client) { + this.service = retrofit.create(ImplicitsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Implicits to be + * used by Retrofit to perform actually REST calls. + */ + interface ImplicitsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Implicits getRequiredPath" }) + @GET("reqopt/implicit/required/path/{pathParameter}") + Observable> getRequiredPath(@Path("pathParameter") String pathParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Implicits putOptionalQuery" }) + @PUT("reqopt/implicit/optional/query") + Observable> putOptionalQuery(@Query("queryParameter") String queryParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Implicits putOptionalHeader" }) + @PUT("reqopt/implicit/optional/header") + Observable> putOptionalHeader(@Header("queryParameter") String queryParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Implicits putOptionalBody" }) + @PUT("reqopt/implicit/optional/body") + Observable> putOptionalBody(@Body String bodyParameter); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Implicits getRequiredGlobalPath" }) + @GET("reqopt/global/required/path/{required-global-path}") + Observable> getRequiredGlobalPath(@Path("required-global-path") String requiredGlobalPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Implicits getRequiredGlobalQuery" }) + @GET("reqopt/global/required/query") + Observable> getRequiredGlobalQuery(@Query("required-global-query") String requiredGlobalQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.requiredoptional.Implicits getOptionalGlobalQuery" }) + @GET("reqopt/global/optional/query") + Observable> getOptionalGlobalQuery(@Query("optional-global-query") Integer optionalGlobalQuery); + + } + + /** + * Test implicitly required path parameter. + * + * @param pathParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error getRequiredPath(String pathParameter) { + return getRequiredPathWithServiceResponseAsync(pathParameter).toBlocking().single().body(); + } + + /** + * Test implicitly required path parameter. + * + * @param pathParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getRequiredPathAsync(String pathParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getRequiredPathWithServiceResponseAsync(pathParameter), serviceCallback); + } + + /** + * Test implicitly required path parameter. + * + * @param pathParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable getRequiredPathAsync(String pathParameter) { + return getRequiredPathWithServiceResponseAsync(pathParameter).map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly required path parameter. + * + * @param pathParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> getRequiredPathWithServiceResponseAsync(String pathParameter) { + if (pathParameter == null) { + throw new IllegalArgumentException("Parameter pathParameter is required and cannot be null."); + } + return service.getRequiredPath(pathParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getRequiredPathDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getRequiredPathDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putOptionalQuery() { + putOptionalQueryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test implicitly optional query parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putOptionalQueryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putOptionalQueryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putOptionalQueryAsync() { + return putOptionalQueryWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putOptionalQueryWithServiceResponseAsync() { + final String queryParameter = null; + return service.putOptionalQuery(queryParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putOptionalQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test implicitly optional query parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putOptionalQuery(String queryParameter) { + putOptionalQueryWithServiceResponseAsync(queryParameter).toBlocking().single().body(); + } + + /** + * Test implicitly optional query parameter. + * + * @param queryParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putOptionalQueryAsync(String queryParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putOptionalQueryWithServiceResponseAsync(queryParameter), serviceCallback); + } + + /** + * Test implicitly optional query parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putOptionalQueryAsync(String queryParameter) { + return putOptionalQueryWithServiceResponseAsync(queryParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly optional query parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putOptionalQueryWithServiceResponseAsync(String queryParameter) { + return service.putOptionalQuery(queryParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putOptionalQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putOptionalQueryDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test implicitly optional header parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putOptionalHeader() { + putOptionalHeaderWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test implicitly optional header parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putOptionalHeaderAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putOptionalHeaderWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test implicitly optional header parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putOptionalHeaderAsync() { + return putOptionalHeaderWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly optional header parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putOptionalHeaderWithServiceResponseAsync() { + final String queryParameter = null; + return service.putOptionalHeader(queryParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putOptionalHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test implicitly optional header parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putOptionalHeader(String queryParameter) { + putOptionalHeaderWithServiceResponseAsync(queryParameter).toBlocking().single().body(); + } + + /** + * Test implicitly optional header parameter. + * + * @param queryParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putOptionalHeaderAsync(String queryParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putOptionalHeaderWithServiceResponseAsync(queryParameter), serviceCallback); + } + + /** + * Test implicitly optional header parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putOptionalHeaderAsync(String queryParameter) { + return putOptionalHeaderWithServiceResponseAsync(queryParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly optional header parameter. + * + * @param queryParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putOptionalHeaderWithServiceResponseAsync(String queryParameter) { + return service.putOptionalHeader(queryParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putOptionalHeaderDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putOptionalHeaderDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test implicitly optional body parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putOptionalBody() { + putOptionalBodyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test implicitly optional body parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putOptionalBodyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putOptionalBodyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test implicitly optional body parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putOptionalBodyAsync() { + return putOptionalBodyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly optional body parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putOptionalBodyWithServiceResponseAsync() { + final String bodyParameter = null; + return service.putOptionalBody(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putOptionalBodyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Test implicitly optional body parameter. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void putOptionalBody(String bodyParameter) { + putOptionalBodyWithServiceResponseAsync(bodyParameter).toBlocking().single().body(); + } + + /** + * Test implicitly optional body parameter. + * + * @param bodyParameter the String value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture putOptionalBodyAsync(String bodyParameter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(putOptionalBodyWithServiceResponseAsync(bodyParameter), serviceCallback); + } + + /** + * Test implicitly optional body parameter. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable putOptionalBodyAsync(String bodyParameter) { + return putOptionalBodyWithServiceResponseAsync(bodyParameter).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly optional body parameter. + * + * @param bodyParameter the String value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> putOptionalBodyWithServiceResponseAsync(String bodyParameter) { + return service.putOptionalBody(bodyParameter) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = putOptionalBodyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse putOptionalBodyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test implicitly required path parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error getRequiredGlobalPath() { + return getRequiredGlobalPathWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test implicitly required path parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getRequiredGlobalPathAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getRequiredGlobalPathWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test implicitly required path parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable getRequiredGlobalPathAsync() { + return getRequiredGlobalPathWithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly required path parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> getRequiredGlobalPathWithServiceResponseAsync() { + if (this.client.requiredGlobalPath() == null) { + throw new IllegalArgumentException("Parameter this.client.requiredGlobalPath() is required and cannot be null."); + } + return service.getRequiredGlobalPath(this.client.requiredGlobalPath()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getRequiredGlobalPathDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getRequiredGlobalPathDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test implicitly required query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error getRequiredGlobalQuery() { + return getRequiredGlobalQueryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test implicitly required query parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getRequiredGlobalQueryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getRequiredGlobalQueryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test implicitly required query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable getRequiredGlobalQueryAsync() { + return getRequiredGlobalQueryWithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly required query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> getRequiredGlobalQueryWithServiceResponseAsync() { + if (this.client.requiredGlobalQuery() == null) { + throw new IllegalArgumentException("Parameter this.client.requiredGlobalQuery() is required and cannot be null."); + } + return service.getRequiredGlobalQuery(this.client.requiredGlobalQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getRequiredGlobalQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getRequiredGlobalQueryDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Error object if successful. + */ + public Error getOptionalGlobalQuery() { + return getOptionalGlobalQueryWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Test implicitly optional query parameter. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getOptionalGlobalQueryAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getOptionalGlobalQueryWithServiceResponseAsync(), serviceCallback); + } + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable getOptionalGlobalQueryAsync() { + return getOptionalGlobalQueryWithServiceResponseAsync().map(new Func1, Error>() { + @Override + public Error call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Test implicitly optional query parameter. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Error object + */ + public Observable> getOptionalGlobalQueryWithServiceResponseAsync() { + return service.getOptionalGlobalQuery(this.client.optionalGlobalQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getOptionalGlobalQueryDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getOptionalGlobalQueryDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/package-info.java new file mode 100644 index 0000000000..e3adef46ea --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestRequiredOptionalTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.requiredoptional.implementation; diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/ArrayOptionalWrapper.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ArrayOptionalWrapper.java new file mode 100644 index 0000000000..912b561718 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ArrayOptionalWrapper.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ArrayOptionalWrapper model. + */ +public class ArrayOptionalWrapper { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ArrayOptionalWrapper object itself. + */ + public ArrayOptionalWrapper withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/ArrayWrapper.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ArrayWrapper.java new file mode 100644 index 0000000000..3f6d50e66e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ArrayWrapper.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ArrayWrapper model. + */ +public class ArrayWrapper { + /** + * The value property. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ArrayWrapper object itself. + */ + public ArrayWrapper withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/ClassOptionalWrapper.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ClassOptionalWrapper.java new file mode 100644 index 0000000000..8498cf5e3e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ClassOptionalWrapper.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ClassOptionalWrapper model. + */ +public class ClassOptionalWrapper { + /** + * The value property. + */ + @JsonProperty(value = "value") + private Product value; + + /** + * Get the value value. + * + * @return the value value + */ + public Product value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ClassOptionalWrapper object itself. + */ + public ClassOptionalWrapper withValue(Product value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/ClassWrapper.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ClassWrapper.java new file mode 100644 index 0000000000..1f3c06accc --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ClassWrapper.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ClassWrapper model. + */ +public class ClassWrapper { + /** + * The value property. + */ + @JsonProperty(value = "value", required = true) + private Product value; + + /** + * Get the value value. + * + * @return the value value + */ + public Product value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the ClassWrapper object itself. + */ + public ClassWrapper withValue(Product value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/Error.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/Error.java new file mode 100644 index 0000000000..52724c2e3a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ErrorException.java new file mode 100644 index 0000000000..c8235561a0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/IntOptionalWrapper.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/IntOptionalWrapper.java new file mode 100644 index 0000000000..ba3bd79eba --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/IntOptionalWrapper.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IntOptionalWrapper model. + */ +public class IntOptionalWrapper { + /** + * The value property. + */ + @JsonProperty(value = "value") + private Integer value; + + /** + * Get the value value. + * + * @return the value value + */ + public Integer value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the IntOptionalWrapper object itself. + */ + public IntOptionalWrapper withValue(Integer value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/IntWrapper.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/IntWrapper.java new file mode 100644 index 0000000000..da67e356cb --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/IntWrapper.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The IntWrapper model. + */ +public class IntWrapper { + /** + * The value property. + */ + @JsonProperty(value = "value", required = true) + private int value; + + /** + * Get the value value. + * + * @return the value value + */ + public int value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the IntWrapper object itself. + */ + public IntWrapper withValue(int value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/Product.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/Product.java new file mode 100644 index 0000000000..3adb748432 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/Product.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Product model. + */ +public class Product { + /** + * The id property. + */ + @JsonProperty(value = "id", required = true) + private int id; + + /** + * The name property. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the id value. + * + * @return the id value + */ + public int id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the Product object itself. + */ + public Product withId(int id) { + this.id = id; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the Product object itself. + */ + public Product withName(String name) { + this.name = name; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/StringOptionalWrapper.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/StringOptionalWrapper.java new file mode 100644 index 0000000000..cac6738006 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/StringOptionalWrapper.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The StringOptionalWrapper model. + */ +public class StringOptionalWrapper { + /** + * The value property. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the StringOptionalWrapper object itself. + */ + public StringOptionalWrapper withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/StringWrapper.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/StringWrapper.java new file mode 100644 index 0000000000..2c983ed3e6 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/StringWrapper.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.requiredoptional.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The StringWrapper model. + */ +public class StringWrapper { + /** + * The value property. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the StringWrapper object itself. + */ + public StringWrapper withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/models/package-info.java b/test/vanilla/src/main/java/fixtures/requiredoptional/models/package-info.java new file mode 100644 index 0000000000..635733981a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestRequiredOptionalTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.requiredoptional.models; diff --git a/test/vanilla/src/main/java/fixtures/requiredoptional/package-info.java b/test/vanilla/src/main/java/fixtures/requiredoptional/package-info.java new file mode 100644 index 0000000000..fe142ce32e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/requiredoptional/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestRequiredOptionalTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.requiredoptional; diff --git a/test/vanilla/src/main/java/fixtures/url/AutoRestUrlTestService.java b/test/vanilla/src/main/java/fixtures/url/AutoRestUrlTestService.java new file mode 100644 index 0000000000..effe812b00 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/AutoRestUrlTestService.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url; + +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestUrlTestService class. + */ +public interface AutoRestUrlTestService { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets A string value 'globalItemStringPath' that appears in the path. + * + * @return the globalStringPath value. + */ + String globalStringPath(); + + /** + * Sets A string value 'globalItemStringPath' that appears in the path. + * + * @param globalStringPath the globalStringPath value. + * @return the service client itself + */ + AutoRestUrlTestService withGlobalStringPath(String globalStringPath); + + /** + * Gets should contain value null. + * + * @return the globalStringQuery value. + */ + String globalStringQuery(); + + /** + * Sets should contain value null. + * + * @param globalStringQuery the globalStringQuery value. + * @return the service client itself + */ + AutoRestUrlTestService withGlobalStringQuery(String globalStringQuery); + + /** + * Gets the Paths object to access its operations. + * @return the Paths object. + */ + Paths paths(); + + /** + * Gets the Queries object to access its operations. + * @return the Queries object. + */ + Queries queries(); + + /** + * Gets the PathItems object to access its operations. + * @return the PathItems object. + */ + PathItems pathItems(); + +} diff --git a/test/vanilla/src/main/java/fixtures/url/PathItems.java b/test/vanilla/src/main/java/fixtures/url/PathItems.java new file mode 100644 index 0000000000..1c6665e478 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/PathItems.java @@ -0,0 +1,389 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.url.models.ErrorException; +import java.io.IOException; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PathItems. + */ +public interface PathItems { + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getAllWithValues(String localStringPath, String pathItemStringPath); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAllWithValuesAsync(String localStringPath, String pathItemStringPath, final ServiceCallback serviceCallback); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getAllWithValuesAsync(String localStringPath, String pathItemStringPath); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getAllWithValuesWithServiceResponseAsync(String localStringPath, String pathItemStringPath); + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getAllWithValues(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getAllWithValuesAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback serviceCallback); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getAllWithValuesAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getAllWithValuesWithServiceResponseAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getGlobalQueryNull(String localStringPath, String pathItemStringPath); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getGlobalQueryNullAsync(String localStringPath, String pathItemStringPath, final ServiceCallback serviceCallback); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getGlobalQueryNullAsync(String localStringPath, String pathItemStringPath); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getGlobalQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath); + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getGlobalQueryNull(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getGlobalQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback serviceCallback); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getGlobalQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getGlobalQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getGlobalAndLocalQueryNull(String localStringPath, String pathItemStringPath); + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getGlobalAndLocalQueryNullAsync(String localStringPath, String pathItemStringPath, final ServiceCallback serviceCallback); + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getGlobalAndLocalQueryNullAsync(String localStringPath, String pathItemStringPath); + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getGlobalAndLocalQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath); + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain null value + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getGlobalAndLocalQueryNull(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain null value + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getGlobalAndLocalQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback serviceCallback); + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain null value + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getGlobalAndLocalQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain null value + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getGlobalAndLocalQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getLocalPathItemQueryNull(String localStringPath, String pathItemStringPath); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLocalPathItemQueryNullAsync(String localStringPath, String pathItemStringPath, final ServiceCallback serviceCallback); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getLocalPathItemQueryNullAsync(String localStringPath, String pathItemStringPath); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getLocalPathItemQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath); + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value null + * @param pathItemStringQuery should contain value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getLocalPathItemQueryNull(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value null + * @param pathItemStringQuery should contain value null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLocalPathItemQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback serviceCallback); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value null + * @param pathItemStringQuery should contain value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getLocalPathItemQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value null + * @param pathItemStringQuery should contain value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getLocalPathItemQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery); + +} diff --git a/test/vanilla/src/main/java/fixtures/url/Paths.java b/test/vanilla/src/main/java/fixtures/url/Paths.java new file mode 100644 index 0000000000..6ab9a26bb3 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/Paths.java @@ -0,0 +1,953 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.url.models.ErrorException; +import fixtures.url.models.UriColor; +import java.io.IOException; +import java.util.List; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public interface Paths { + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getBooleanTrue(); + + /** + * Get true Boolean value on path. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBooleanTrueAsync(final ServiceCallback serviceCallback); + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getBooleanTrueAsync(); + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getBooleanTrueWithServiceResponseAsync(); + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getBooleanFalse(); + + /** + * Get false Boolean value on path. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBooleanFalseAsync(final ServiceCallback serviceCallback); + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getBooleanFalseAsync(); + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getBooleanFalseWithServiceResponseAsync(); + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getIntOneMillion(); + + /** + * Get '1000000' integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIntOneMillionAsync(final ServiceCallback serviceCallback); + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getIntOneMillionAsync(); + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getIntOneMillionWithServiceResponseAsync(); + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getIntNegativeOneMillion(); + + /** + * Get '-1000000' integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIntNegativeOneMillionAsync(final ServiceCallback serviceCallback); + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getIntNegativeOneMillionAsync(); + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getIntNegativeOneMillionWithServiceResponseAsync(); + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getTenBillion(); + + /** + * Get '10000000000' 64 bit integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getTenBillionAsync(final ServiceCallback serviceCallback); + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getTenBillionAsync(); + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getTenBillionWithServiceResponseAsync(); + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getNegativeTenBillion(); + + /** + * Get '-10000000000' 64 bit integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNegativeTenBillionAsync(final ServiceCallback serviceCallback); + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getNegativeTenBillionAsync(); + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getNegativeTenBillionWithServiceResponseAsync(); + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void floatScientificPositive(); + + /** + * Get '1.034E+20' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture floatScientificPositiveAsync(final ServiceCallback serviceCallback); + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable floatScientificPositiveAsync(); + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> floatScientificPositiveWithServiceResponseAsync(); + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void floatScientificNegative(); + + /** + * Get '-1.034E-20' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture floatScientificNegativeAsync(final ServiceCallback serviceCallback); + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable floatScientificNegativeAsync(); + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> floatScientificNegativeWithServiceResponseAsync(); + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void doubleDecimalPositive(); + + /** + * Get '9999999.999' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture doubleDecimalPositiveAsync(final ServiceCallback serviceCallback); + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable doubleDecimalPositiveAsync(); + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> doubleDecimalPositiveWithServiceResponseAsync(); + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void doubleDecimalNegative(); + + /** + * Get '-9999999.999' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture doubleDecimalNegativeAsync(final ServiceCallback serviceCallback); + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable doubleDecimalNegativeAsync(); + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> doubleDecimalNegativeWithServiceResponseAsync(); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringUnicode(); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringUnicodeAsync(final ServiceCallback serviceCallback); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringUnicodeAsync(); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringUnicodeWithServiceResponseAsync(); + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringUrlEncoded(); + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringUrlEncodedAsync(final ServiceCallback serviceCallback); + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringUrlEncodedAsync(); + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringUrlEncodedWithServiceResponseAsync(); + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringEmpty(); + + /** + * Get ''. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringEmptyAsync(); + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringEmptyWithServiceResponseAsync(); + + /** + * Get null (should throw). + * + * @param stringPath null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringNull(String stringPath); + + /** + * Get null (should throw). + * + * @param stringPath null string value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringNullAsync(String stringPath, final ServiceCallback serviceCallback); + + /** + * Get null (should throw). + * + * @param stringPath null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringNullAsync(String stringPath); + + /** + * Get null (should throw). + * + * @param stringPath null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringNullWithServiceResponseAsync(String stringPath); + + /** + * Get using uri with 'green color' in path parameter. + * + * @param enumPath send the value green. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void enumValid(UriColor enumPath); + + /** + * Get using uri with 'green color' in path parameter. + * + * @param enumPath send the value green. Possible values include: 'red color', 'green color', 'blue color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture enumValidAsync(UriColor enumPath, final ServiceCallback serviceCallback); + + /** + * Get using uri with 'green color' in path parameter. + * + * @param enumPath send the value green. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable enumValidAsync(UriColor enumPath); + + /** + * Get using uri with 'green color' in path parameter. + * + * @param enumPath send the value green. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> enumValidWithServiceResponseAsync(UriColor enumPath); + + /** + * Get null (should throw on the client before the request is sent on wire). + * + * @param enumPath send null should throw. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void enumNull(UriColor enumPath); + + /** + * Get null (should throw on the client before the request is sent on wire). + * + * @param enumPath send null should throw. Possible values include: 'red color', 'green color', 'blue color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture enumNullAsync(UriColor enumPath, final ServiceCallback serviceCallback); + + /** + * Get null (should throw on the client before the request is sent on wire). + * + * @param enumPath send null should throw. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable enumNullAsync(UriColor enumPath); + + /** + * Get null (should throw on the client before the request is sent on wire). + * + * @param enumPath send null should throw. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> enumNullWithServiceResponseAsync(UriColor enumPath); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param bytePath '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void byteMultiByte(byte[] bytePath); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param bytePath '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture byteMultiByteAsync(byte[] bytePath, final ServiceCallback serviceCallback); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param bytePath '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable byteMultiByteAsync(byte[] bytePath); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param bytePath '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> byteMultiByteWithServiceResponseAsync(byte[] bytePath); + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void byteEmpty(); + + /** + * Get '' as byte array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture byteEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable byteEmptyAsync(); + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> byteEmptyWithServiceResponseAsync(); + + /** + * Get null as byte array (should throw). + * + * @param bytePath null as byte array (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void byteNull(byte[] bytePath); + + /** + * Get null as byte array (should throw). + * + * @param bytePath null as byte array (should throw) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture byteNullAsync(byte[] bytePath, final ServiceCallback serviceCallback); + + /** + * Get null as byte array (should throw). + * + * @param bytePath null as byte array (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable byteNullAsync(byte[] bytePath); + + /** + * Get null as byte array (should throw). + * + * @param bytePath null as byte array (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> byteNullWithServiceResponseAsync(byte[] bytePath); + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateValid(); + + /** + * Get '2012-01-01' as date. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateValidAsync(final ServiceCallback serviceCallback); + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateValidAsync(); + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateValidWithServiceResponseAsync(); + + /** + * Get null as date - this should throw or be unusable on the client side, depending on date representation. + * + * @param datePath null as date (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateNull(LocalDate datePath); + + /** + * Get null as date - this should throw or be unusable on the client side, depending on date representation. + * + * @param datePath null as date (should throw) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateNullAsync(LocalDate datePath, final ServiceCallback serviceCallback); + + /** + * Get null as date - this should throw or be unusable on the client side, depending on date representation. + * + * @param datePath null as date (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateNullAsync(LocalDate datePath); + + /** + * Get null as date - this should throw or be unusable on the client side, depending on date representation. + * + * @param datePath null as date (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateNullWithServiceResponseAsync(LocalDate datePath); + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateTimeValid(); + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateTimeValidAsync(final ServiceCallback serviceCallback); + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateTimeValidAsync(); + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateTimeValidWithServiceResponseAsync(); + + /** + * Get null as date-time, should be disallowed or throw depending on representation of date-time. + * + * @param dateTimePath null as date-time + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateTimeNull(DateTime dateTimePath); + + /** + * Get null as date-time, should be disallowed or throw depending on representation of date-time. + * + * @param dateTimePath null as date-time + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateTimeNullAsync(DateTime dateTimePath, final ServiceCallback serviceCallback); + + /** + * Get null as date-time, should be disallowed or throw depending on representation of date-time. + * + * @param dateTimePath null as date-time + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateTimeNullAsync(DateTime dateTimePath); + + /** + * Get null as date-time, should be disallowed or throw depending on representation of date-time. + * + * @param dateTimePath null as date-time + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateTimeNullWithServiceResponseAsync(DateTime dateTimePath); + + /** + * Get 'lorem' encoded value as 'bG9yZW0' (base64url). + * + * @param base64UrlPath base64url encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void base64Url(byte[] base64UrlPath); + + /** + * Get 'lorem' encoded value as 'bG9yZW0' (base64url). + * + * @param base64UrlPath base64url encoded value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture base64UrlAsync(byte[] base64UrlPath, final ServiceCallback serviceCallback); + + /** + * Get 'lorem' encoded value as 'bG9yZW0' (base64url). + * + * @param base64UrlPath base64url encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable base64UrlAsync(byte[] base64UrlPath); + + /** + * Get 'lorem' encoded value as 'bG9yZW0' (base64url). + * + * @param base64UrlPath base64url encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> base64UrlWithServiceResponseAsync(byte[] base64UrlPath); + + /** + * Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayPath an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayCsvInPath(List arrayPath); + + /** + * Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayPath an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayCsvInPathAsync(List arrayPath, final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayPath an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayCsvInPathAsync(List arrayPath); + + /** + * Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayPath an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayCsvInPathWithServiceResponseAsync(List arrayPath); + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void unixTimeUrl(DateTime unixTimeUrlPath); + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture unixTimeUrlAsync(DateTime unixTimeUrlPath, final ServiceCallback serviceCallback); + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable unixTimeUrlAsync(DateTime unixTimeUrlPath); + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> unixTimeUrlWithServiceResponseAsync(DateTime unixTimeUrlPath); + +} diff --git a/test/vanilla/src/main/java/fixtures/url/Queries.java b/test/vanilla/src/main/java/fixtures/url/Queries.java new file mode 100644 index 0000000000..050c80a0f1 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/Queries.java @@ -0,0 +1,1851 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url; + +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.url.models.ErrorException; +import fixtures.url.models.UriColor; +import java.io.IOException; +import java.util.List; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Queries. + */ +public interface Queries { + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getBooleanTrue(); + + /** + * Get true Boolean value on path. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBooleanTrueAsync(final ServiceCallback serviceCallback); + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getBooleanTrueAsync(); + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getBooleanTrueWithServiceResponseAsync(); + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getBooleanFalse(); + + /** + * Get false Boolean value on path. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBooleanFalseAsync(final ServiceCallback serviceCallback); + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getBooleanFalseAsync(); + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getBooleanFalseWithServiceResponseAsync(); + + /** + * Get null Boolean value on query (query string should be absent). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getBooleanNull(); + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBooleanNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null Boolean value on query (query string should be absent). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getBooleanNullAsync(); + + /** + * Get null Boolean value on query (query string should be absent). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getBooleanNullWithServiceResponseAsync(); + /** + * Get null Boolean value on query (query string should be absent). + * + * @param boolQuery null boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getBooleanNull(Boolean boolQuery); + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param boolQuery null boolean value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getBooleanNullAsync(Boolean boolQuery, final ServiceCallback serviceCallback); + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param boolQuery null boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getBooleanNullAsync(Boolean boolQuery); + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param boolQuery null boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getBooleanNullWithServiceResponseAsync(Boolean boolQuery); + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getIntOneMillion(); + + /** + * Get '1000000' integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIntOneMillionAsync(final ServiceCallback serviceCallback); + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getIntOneMillionAsync(); + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getIntOneMillionWithServiceResponseAsync(); + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getIntNegativeOneMillion(); + + /** + * Get '-1000000' integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIntNegativeOneMillionAsync(final ServiceCallback serviceCallback); + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getIntNegativeOneMillionAsync(); + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getIntNegativeOneMillionWithServiceResponseAsync(); + + /** + * Get null integer value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getIntNull(); + + /** + * Get null integer value (no query parameter). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIntNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null integer value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getIntNullAsync(); + + /** + * Get null integer value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getIntNullWithServiceResponseAsync(); + /** + * Get null integer value (no query parameter). + * + * @param intQuery null integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getIntNull(Integer intQuery); + + /** + * Get null integer value (no query parameter). + * + * @param intQuery null integer value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getIntNullAsync(Integer intQuery, final ServiceCallback serviceCallback); + + /** + * Get null integer value (no query parameter). + * + * @param intQuery null integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getIntNullAsync(Integer intQuery); + + /** + * Get null integer value (no query parameter). + * + * @param intQuery null integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getIntNullWithServiceResponseAsync(Integer intQuery); + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getTenBillion(); + + /** + * Get '10000000000' 64 bit integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getTenBillionAsync(final ServiceCallback serviceCallback); + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getTenBillionAsync(); + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getTenBillionWithServiceResponseAsync(); + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getNegativeTenBillion(); + + /** + * Get '-10000000000' 64 bit integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getNegativeTenBillionAsync(final ServiceCallback serviceCallback); + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getNegativeTenBillionAsync(); + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getNegativeTenBillionWithServiceResponseAsync(); + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getLongNull(); + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLongNullAsync(final ServiceCallback serviceCallback); + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getLongNullAsync(); + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getLongNullWithServiceResponseAsync(); + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param longQuery null 64 bit integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getLongNull(Long longQuery); + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param longQuery null 64 bit integer value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getLongNullAsync(Long longQuery, final ServiceCallback serviceCallback); + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param longQuery null 64 bit integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getLongNullAsync(Long longQuery); + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param longQuery null 64 bit integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getLongNullWithServiceResponseAsync(Long longQuery); + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void floatScientificPositive(); + + /** + * Get '1.034E+20' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture floatScientificPositiveAsync(final ServiceCallback serviceCallback); + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable floatScientificPositiveAsync(); + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> floatScientificPositiveWithServiceResponseAsync(); + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void floatScientificNegative(); + + /** + * Get '-1.034E-20' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture floatScientificNegativeAsync(final ServiceCallback serviceCallback); + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable floatScientificNegativeAsync(); + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> floatScientificNegativeWithServiceResponseAsync(); + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void floatNull(); + + /** + * Get null numeric value (no query parameter). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture floatNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable floatNullAsync(); + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> floatNullWithServiceResponseAsync(); + /** + * Get null numeric value (no query parameter). + * + * @param floatQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void floatNull(Double floatQuery); + + /** + * Get null numeric value (no query parameter). + * + * @param floatQuery null numeric value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture floatNullAsync(Double floatQuery, final ServiceCallback serviceCallback); + + /** + * Get null numeric value (no query parameter). + * + * @param floatQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable floatNullAsync(Double floatQuery); + + /** + * Get null numeric value (no query parameter). + * + * @param floatQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> floatNullWithServiceResponseAsync(Double floatQuery); + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void doubleDecimalPositive(); + + /** + * Get '9999999.999' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture doubleDecimalPositiveAsync(final ServiceCallback serviceCallback); + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable doubleDecimalPositiveAsync(); + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> doubleDecimalPositiveWithServiceResponseAsync(); + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void doubleDecimalNegative(); + + /** + * Get '-9999999.999' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture doubleDecimalNegativeAsync(final ServiceCallback serviceCallback); + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable doubleDecimalNegativeAsync(); + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> doubleDecimalNegativeWithServiceResponseAsync(); + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void doubleNull(); + + /** + * Get null numeric value (no query parameter). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture doubleNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable doubleNullAsync(); + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> doubleNullWithServiceResponseAsync(); + /** + * Get null numeric value (no query parameter). + * + * @param doubleQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void doubleNull(Double doubleQuery); + + /** + * Get null numeric value (no query parameter). + * + * @param doubleQuery null numeric value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture doubleNullAsync(Double doubleQuery, final ServiceCallback serviceCallback); + + /** + * Get null numeric value (no query parameter). + * + * @param doubleQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable doubleNullAsync(Double doubleQuery); + + /** + * Get null numeric value (no query parameter). + * + * @param doubleQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> doubleNullWithServiceResponseAsync(Double doubleQuery); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringUnicode(); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringUnicodeAsync(final ServiceCallback serviceCallback); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringUnicodeAsync(); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringUnicodeWithServiceResponseAsync(); + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringUrlEncoded(); + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringUrlEncodedAsync(final ServiceCallback serviceCallback); + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringUrlEncodedAsync(); + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringUrlEncodedWithServiceResponseAsync(); + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringEmpty(); + + /** + * Get ''. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringEmptyAsync(); + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringEmptyWithServiceResponseAsync(); + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringNull(); + + /** + * Get null (no query parameter in url). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringNullAsync(); + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringNullWithServiceResponseAsync(); + /** + * Get null (no query parameter in url). + * + * @param stringQuery null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void stringNull(String stringQuery); + + /** + * Get null (no query parameter in url). + * + * @param stringQuery null string value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture stringNullAsync(String stringQuery, final ServiceCallback serviceCallback); + + /** + * Get null (no query parameter in url). + * + * @param stringQuery null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable stringNullAsync(String stringQuery); + + /** + * Get null (no query parameter in url). + * + * @param stringQuery null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> stringNullWithServiceResponseAsync(String stringQuery); + + /** + * Get using uri with query parameter 'green color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void enumValid(); + + /** + * Get using uri with query parameter 'green color'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture enumValidAsync(final ServiceCallback serviceCallback); + + /** + * Get using uri with query parameter 'green color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable enumValidAsync(); + + /** + * Get using uri with query parameter 'green color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> enumValidWithServiceResponseAsync(); + /** + * Get using uri with query parameter 'green color'. + * + * @param enumQuery 'green color' enum value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void enumValid(UriColor enumQuery); + + /** + * Get using uri with query parameter 'green color'. + * + * @param enumQuery 'green color' enum value. Possible values include: 'red color', 'green color', 'blue color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture enumValidAsync(UriColor enumQuery, final ServiceCallback serviceCallback); + + /** + * Get using uri with query parameter 'green color'. + * + * @param enumQuery 'green color' enum value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable enumValidAsync(UriColor enumQuery); + + /** + * Get using uri with query parameter 'green color'. + * + * @param enumQuery 'green color' enum value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> enumValidWithServiceResponseAsync(UriColor enumQuery); + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void enumNull(); + + /** + * Get null (no query parameter in url). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture enumNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable enumNullAsync(); + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> enumNullWithServiceResponseAsync(); + /** + * Get null (no query parameter in url). + * + * @param enumQuery null string value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void enumNull(UriColor enumQuery); + + /** + * Get null (no query parameter in url). + * + * @param enumQuery null string value. Possible values include: 'red color', 'green color', 'blue color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture enumNullAsync(UriColor enumQuery, final ServiceCallback serviceCallback); + + /** + * Get null (no query parameter in url). + * + * @param enumQuery null string value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable enumNullAsync(UriColor enumQuery); + + /** + * Get null (no query parameter in url). + * + * @param enumQuery null string value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> enumNullWithServiceResponseAsync(UriColor enumQuery); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void byteMultiByte(); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture byteMultiByteAsync(final ServiceCallback serviceCallback); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable byteMultiByteAsync(); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> byteMultiByteWithServiceResponseAsync(); + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param byteQuery '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void byteMultiByte(byte[] byteQuery); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param byteQuery '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture byteMultiByteAsync(byte[] byteQuery, final ServiceCallback serviceCallback); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param byteQuery '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable byteMultiByteAsync(byte[] byteQuery); + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param byteQuery '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> byteMultiByteWithServiceResponseAsync(byte[] byteQuery); + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void byteEmpty(); + + /** + * Get '' as byte array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture byteEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable byteEmptyAsync(); + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> byteEmptyWithServiceResponseAsync(); + + /** + * Get null as byte array (no query parameters in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void byteNull(); + + /** + * Get null as byte array (no query parameters in uri). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture byteNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null as byte array (no query parameters in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable byteNullAsync(); + + /** + * Get null as byte array (no query parameters in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> byteNullWithServiceResponseAsync(); + /** + * Get null as byte array (no query parameters in uri). + * + * @param byteQuery null as byte array (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void byteNull(byte[] byteQuery); + + /** + * Get null as byte array (no query parameters in uri). + * + * @param byteQuery null as byte array (no query parameters in uri) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture byteNullAsync(byte[] byteQuery, final ServiceCallback serviceCallback); + + /** + * Get null as byte array (no query parameters in uri). + * + * @param byteQuery null as byte array (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable byteNullAsync(byte[] byteQuery); + + /** + * Get null as byte array (no query parameters in uri). + * + * @param byteQuery null as byte array (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> byteNullWithServiceResponseAsync(byte[] byteQuery); + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateValid(); + + /** + * Get '2012-01-01' as date. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateValidAsync(final ServiceCallback serviceCallback); + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateValidAsync(); + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateValidWithServiceResponseAsync(); + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateNull(); + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateNullAsync(); + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateNullWithServiceResponseAsync(); + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param dateQuery null as date (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateNull(LocalDate dateQuery); + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param dateQuery null as date (no query parameters in uri) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateNullAsync(LocalDate dateQuery, final ServiceCallback serviceCallback); + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param dateQuery null as date (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateNullAsync(LocalDate dateQuery); + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param dateQuery null as date (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateNullWithServiceResponseAsync(LocalDate dateQuery); + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateTimeValid(); + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateTimeValidAsync(final ServiceCallback serviceCallback); + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateTimeValidAsync(); + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateTimeValidWithServiceResponseAsync(); + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateTimeNull(); + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateTimeNullAsync(final ServiceCallback serviceCallback); + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateTimeNullAsync(); + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateTimeNullWithServiceResponseAsync(); + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param dateTimeQuery null as date-time (no query parameters) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void dateTimeNull(DateTime dateTimeQuery); + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param dateTimeQuery null as date-time (no query parameters) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture dateTimeNullAsync(DateTime dateTimeQuery, final ServiceCallback serviceCallback); + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param dateTimeQuery null as date-time (no query parameters) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable dateTimeNullAsync(DateTime dateTimeQuery); + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param dateTimeQuery null as date-time (no query parameters) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> dateTimeNullWithServiceResponseAsync(DateTime dateTimeQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringCsvValid(); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringCsvValidAsync(final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringCsvValidAsync(); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringCsvValidWithServiceResponseAsync(); + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringCsvValid(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringCsvValidAsync(List arrayQuery, final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringCsvValidAsync(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringCsvValidWithServiceResponseAsync(List arrayQuery); + + /** + * Get a null array of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringCsvNull(); + + /** + * Get a null array of string using the csv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringCsvNullAsync(final ServiceCallback serviceCallback); + + /** + * Get a null array of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringCsvNullAsync(); + + /** + * Get a null array of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringCsvNullWithServiceResponseAsync(); + /** + * Get a null array of string using the csv-array format. + * + * @param arrayQuery a null array of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringCsvNull(List arrayQuery); + + /** + * Get a null array of string using the csv-array format. + * + * @param arrayQuery a null array of string using the csv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringCsvNullAsync(List arrayQuery, final ServiceCallback serviceCallback); + + /** + * Get a null array of string using the csv-array format. + * + * @param arrayQuery a null array of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringCsvNullAsync(List arrayQuery); + + /** + * Get a null array of string using the csv-array format. + * + * @param arrayQuery a null array of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringCsvNullWithServiceResponseAsync(List arrayQuery); + + /** + * Get an empty array [] of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringCsvEmpty(); + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringCsvEmptyAsync(final ServiceCallback serviceCallback); + + /** + * Get an empty array [] of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringCsvEmptyAsync(); + + /** + * Get an empty array [] of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringCsvEmptyWithServiceResponseAsync(); + /** + * Get an empty array [] of string using the csv-array format. + * + * @param arrayQuery an empty array [] of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringCsvEmpty(List arrayQuery); + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param arrayQuery an empty array [] of string using the csv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringCsvEmptyAsync(List arrayQuery, final ServiceCallback serviceCallback); + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param arrayQuery an empty array [] of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringCsvEmptyAsync(List arrayQuery); + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param arrayQuery an empty array [] of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringCsvEmptyWithServiceResponseAsync(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringSsvValid(); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringSsvValidAsync(final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringSsvValidAsync(); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringSsvValidWithServiceResponseAsync(); + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringSsvValid(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringSsvValidAsync(List arrayQuery, final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringSsvValidAsync(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringSsvValidWithServiceResponseAsync(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringTsvValid(); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringTsvValidAsync(final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringTsvValidAsync(); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringTsvValidWithServiceResponseAsync(); + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringTsvValid(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringTsvValidAsync(List arrayQuery, final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringTsvValidAsync(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringTsvValidWithServiceResponseAsync(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringPipesValid(); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringPipesValidAsync(final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringPipesValidAsync(); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringPipesValidWithServiceResponseAsync(); + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void arrayStringPipesValid(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture arrayStringPipesValidAsync(List arrayQuery, final ServiceCallback serviceCallback); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable arrayStringPipesValidAsync(List arrayQuery); + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> arrayStringPipesValidWithServiceResponseAsync(List arrayQuery); + +} diff --git a/test/vanilla/src/main/java/fixtures/url/implementation/AutoRestUrlTestServiceImpl.java b/test/vanilla/src/main/java/fixtures/url/implementation/AutoRestUrlTestServiceImpl.java new file mode 100644 index 0000000000..3c9bcbf56a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/implementation/AutoRestUrlTestServiceImpl.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url.implementation; + +import fixtures.url.AutoRestUrlTestService; +import fixtures.url.Paths; +import fixtures.url.Queries; +import fixtures.url.PathItems; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; + +/** + * Initializes a new instance of the AutoRestUrlTestService class. + */ +public class AutoRestUrlTestServiceImpl extends ServiceClient implements AutoRestUrlTestService { + + /** A string value 'globalItemStringPath' that appears in the path. */ + private String globalStringPath; + + /** + * Gets A string value 'globalItemStringPath' that appears in the path. + * + * @return the globalStringPath value. + */ + public String globalStringPath() { + return this.globalStringPath; + } + + /** + * Sets A string value 'globalItemStringPath' that appears in the path. + * + * @param globalStringPath the globalStringPath value. + * @return the service client itself + */ + public AutoRestUrlTestServiceImpl withGlobalStringPath(String globalStringPath) { + this.globalStringPath = globalStringPath; + return this; + } + + /** should contain value null. */ + private String globalStringQuery; + + /** + * Gets should contain value null. + * + * @return the globalStringQuery value. + */ + public String globalStringQuery() { + return this.globalStringQuery; + } + + /** + * Sets should contain value null. + * + * @param globalStringQuery the globalStringQuery value. + * @return the service client itself + */ + public AutoRestUrlTestServiceImpl withGlobalStringQuery(String globalStringQuery) { + this.globalStringQuery = globalStringQuery; + return this; + } + + /** + * The Paths object to access its operations. + */ + private Paths paths; + + /** + * Gets the Paths object to access its operations. + * @return the Paths object. + */ + public Paths paths() { + return this.paths; + } + + /** + * The Queries object to access its operations. + */ + private Queries queries; + + /** + * Gets the Queries object to access its operations. + * @return the Queries object. + */ + public Queries queries() { + return this.queries; + } + + /** + * The PathItems object to access its operations. + */ + private PathItems pathItems; + + /** + * Gets the PathItems object to access its operations. + * @return the PathItems object. + */ + public PathItems pathItems() { + return this.pathItems; + } + + /** + * Initializes an instance of AutoRestUrlTestService client. + */ + public AutoRestUrlTestServiceImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestUrlTestService client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestUrlTestServiceImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestUrlTestService client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestUrlTestServiceImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestUrlTestService client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestUrlTestServiceImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestUrlTestService client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestUrlTestServiceImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + this.paths = new PathsImpl(retrofit(), this); + this.queries = new QueriesImpl(retrofit(), this); + this.pathItems = new PathItemsImpl(retrofit(), this); + } +} diff --git a/test/vanilla/src/main/java/fixtures/url/implementation/PathItemsImpl.java b/test/vanilla/src/main/java/fixtures/url/implementation/PathItemsImpl.java new file mode 100644 index 0000000000..2b82b3b74e --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/implementation/PathItemsImpl.java @@ -0,0 +1,742 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url.implementation; + +import retrofit2.Retrofit; +import fixtures.url.PathItems; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.url.models.ErrorException; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in PathItems. + */ +public class PathItemsImpl implements PathItems { + /** The Retrofit service to perform REST calls. */ + private PathItemsService service; + /** The service client containing this operation class. */ + private AutoRestUrlTestServiceImpl client; + + /** + * Initializes an instance of PathItems. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PathItemsImpl(Retrofit retrofit, AutoRestUrlTestServiceImpl client) { + this.service = retrofit.create(PathItemsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PathItems to be + * used by Retrofit to perform actually REST calls. + */ + interface PathItemsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.PathItems getAllWithValues" }) + @GET("pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/globalStringQuery/pathItemStringQuery/localStringQuery") + Observable> getAllWithValues(@Path("localStringPath") String localStringPath, @Path("pathItemStringPath") String pathItemStringPath, @Path("globalStringPath") String globalStringPath, @Query("localStringQuery") String localStringQuery, @Query("pathItemStringQuery") String pathItemStringQuery, @Query("globalStringQuery") String globalStringQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.PathItems getGlobalQueryNull" }) + @GET("pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/null/pathItemStringQuery/localStringQuery") + Observable> getGlobalQueryNull(@Path("localStringPath") String localStringPath, @Path("pathItemStringPath") String pathItemStringPath, @Path("globalStringPath") String globalStringPath, @Query("localStringQuery") String localStringQuery, @Query("pathItemStringQuery") String pathItemStringQuery, @Query("globalStringQuery") String globalStringQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.PathItems getGlobalAndLocalQueryNull" }) + @GET("pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/null/pathItemStringQuery/null") + Observable> getGlobalAndLocalQueryNull(@Path("localStringPath") String localStringPath, @Path("pathItemStringPath") String pathItemStringPath, @Path("globalStringPath") String globalStringPath, @Query("localStringQuery") String localStringQuery, @Query("pathItemStringQuery") String pathItemStringQuery, @Query("globalStringQuery") String globalStringQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.PathItems getLocalPathItemQueryNull" }) + @GET("pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/globalStringQuery/null/null") + Observable> getLocalPathItemQueryNull(@Path("localStringPath") String localStringPath, @Path("pathItemStringPath") String pathItemStringPath, @Path("globalStringPath") String globalStringPath, @Query("localStringQuery") String localStringQuery, @Query("pathItemStringQuery") String pathItemStringQuery, @Query("globalStringQuery") String globalStringQuery); + + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getAllWithValues(String localStringPath, String pathItemStringPath) { + getAllWithValuesWithServiceResponseAsync(localStringPath, pathItemStringPath).toBlocking().single().body(); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAllWithValuesAsync(String localStringPath, String pathItemStringPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAllWithValuesWithServiceResponseAsync(localStringPath, pathItemStringPath), serviceCallback); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getAllWithValuesAsync(String localStringPath, String pathItemStringPath) { + return getAllWithValuesWithServiceResponseAsync(localStringPath, pathItemStringPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getAllWithValuesWithServiceResponseAsync(String localStringPath, String pathItemStringPath) { + if (localStringPath == null) { + throw new IllegalArgumentException("Parameter localStringPath is required and cannot be null."); + } + if (pathItemStringPath == null) { + throw new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."); + } + if (this.client.globalStringPath() == null) { + throw new IllegalArgumentException("Parameter this.client.globalStringPath() is required and cannot be null."); + } + final String localStringQuery = null; + final String pathItemStringQuery = null; + return service.getAllWithValues(localStringPath, pathItemStringPath, this.client.globalStringPath(), localStringQuery, pathItemStringQuery, this.client.globalStringQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAllWithValuesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getAllWithValues(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + getAllWithValuesWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery).toBlocking().single().body(); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAllWithValuesAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAllWithValuesWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery), serviceCallback); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getAllWithValuesAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + return getAllWithValuesWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getAllWithValuesWithServiceResponseAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + if (localStringPath == null) { + throw new IllegalArgumentException("Parameter localStringPath is required and cannot be null."); + } + if (pathItemStringPath == null) { + throw new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."); + } + if (this.client.globalStringPath() == null) { + throw new IllegalArgumentException("Parameter this.client.globalStringPath() is required and cannot be null."); + } + return service.getAllWithValues(localStringPath, pathItemStringPath, this.client.globalStringPath(), localStringQuery, pathItemStringQuery, this.client.globalStringQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAllWithValuesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAllWithValuesDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getGlobalQueryNull(String localStringPath, String pathItemStringPath) { + getGlobalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath).toBlocking().single().body(); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getGlobalQueryNullAsync(String localStringPath, String pathItemStringPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGlobalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath), serviceCallback); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getGlobalQueryNullAsync(String localStringPath, String pathItemStringPath) { + return getGlobalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getGlobalQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath) { + if (localStringPath == null) { + throw new IllegalArgumentException("Parameter localStringPath is required and cannot be null."); + } + if (pathItemStringPath == null) { + throw new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."); + } + if (this.client.globalStringPath() == null) { + throw new IllegalArgumentException("Parameter this.client.globalStringPath() is required and cannot be null."); + } + final String localStringQuery = null; + final String pathItemStringQuery = null; + return service.getGlobalQueryNull(localStringPath, pathItemStringPath, this.client.globalStringPath(), localStringQuery, pathItemStringQuery, this.client.globalStringQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGlobalQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getGlobalQueryNull(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + getGlobalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery).toBlocking().single().body(); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getGlobalQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGlobalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery), serviceCallback); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getGlobalQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + return getGlobalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery'. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value 'localStringQuery' + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getGlobalQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + if (localStringPath == null) { + throw new IllegalArgumentException("Parameter localStringPath is required and cannot be null."); + } + if (pathItemStringPath == null) { + throw new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."); + } + if (this.client.globalStringPath() == null) { + throw new IllegalArgumentException("Parameter this.client.globalStringPath() is required and cannot be null."); + } + return service.getGlobalQueryNull(localStringPath, pathItemStringPath, this.client.globalStringPath(), localStringQuery, pathItemStringQuery, this.client.globalStringQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGlobalQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGlobalQueryNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getGlobalAndLocalQueryNull(String localStringPath, String pathItemStringPath) { + getGlobalAndLocalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath).toBlocking().single().body(); + } + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getGlobalAndLocalQueryNullAsync(String localStringPath, String pathItemStringPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGlobalAndLocalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath), serviceCallback); + } + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getGlobalAndLocalQueryNullAsync(String localStringPath, String pathItemStringPath) { + return getGlobalAndLocalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getGlobalAndLocalQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath) { + if (localStringPath == null) { + throw new IllegalArgumentException("Parameter localStringPath is required and cannot be null."); + } + if (pathItemStringPath == null) { + throw new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."); + } + if (this.client.globalStringPath() == null) { + throw new IllegalArgumentException("Parameter this.client.globalStringPath() is required and cannot be null."); + } + final String localStringQuery = null; + final String pathItemStringQuery = null; + return service.getGlobalAndLocalQueryNull(localStringPath, pathItemStringPath, this.client.globalStringPath(), localStringQuery, pathItemStringQuery, this.client.globalStringQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGlobalAndLocalQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain null value + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getGlobalAndLocalQueryNull(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + getGlobalAndLocalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery).toBlocking().single().body(); + } + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain null value + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getGlobalAndLocalQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getGlobalAndLocalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery), serviceCallback); + } + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain null value + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getGlobalAndLocalQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + return getGlobalAndLocalQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain null value + * @param pathItemStringQuery A string value 'pathItemStringQuery' that appears as a query parameter + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getGlobalAndLocalQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + if (localStringPath == null) { + throw new IllegalArgumentException("Parameter localStringPath is required and cannot be null."); + } + if (pathItemStringPath == null) { + throw new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."); + } + if (this.client.globalStringPath() == null) { + throw new IllegalArgumentException("Parameter this.client.globalStringPath() is required and cannot be null."); + } + return service.getGlobalAndLocalQueryNull(localStringPath, pathItemStringPath, this.client.globalStringPath(), localStringQuery, pathItemStringQuery, this.client.globalStringQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getGlobalAndLocalQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getGlobalAndLocalQueryNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getLocalPathItemQueryNull(String localStringPath, String pathItemStringPath) { + getLocalPathItemQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath).toBlocking().single().body(); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLocalPathItemQueryNullAsync(String localStringPath, String pathItemStringPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLocalPathItemQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath), serviceCallback); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getLocalPathItemQueryNullAsync(String localStringPath, String pathItemStringPath) { + return getLocalPathItemQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getLocalPathItemQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath) { + if (localStringPath == null) { + throw new IllegalArgumentException("Parameter localStringPath is required and cannot be null."); + } + if (pathItemStringPath == null) { + throw new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."); + } + if (this.client.globalStringPath() == null) { + throw new IllegalArgumentException("Parameter this.client.globalStringPath() is required and cannot be null."); + } + final String localStringQuery = null; + final String pathItemStringQuery = null; + return service.getLocalPathItemQueryNull(localStringPath, pathItemStringPath, this.client.globalStringPath(), localStringQuery, pathItemStringQuery, this.client.globalStringQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLocalPathItemQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value null + * @param pathItemStringQuery should contain value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getLocalPathItemQueryNull(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + getLocalPathItemQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery).toBlocking().single().body(); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value null + * @param pathItemStringQuery should contain value null + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLocalPathItemQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLocalPathItemQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery), serviceCallback); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value null + * @param pathItemStringQuery should contain value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getLocalPathItemQueryNullAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + return getLocalPathItemQueryNullWithServiceResponseAsync(localStringPath, pathItemStringPath, localStringQuery, pathItemStringQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null. + * + * @param localStringPath should contain value 'localStringPath' + * @param pathItemStringPath A string value 'pathItemStringPath' that appears in the path + * @param localStringQuery should contain value null + * @param pathItemStringQuery should contain value null + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getLocalPathItemQueryNullWithServiceResponseAsync(String localStringPath, String pathItemStringPath, String localStringQuery, String pathItemStringQuery) { + if (localStringPath == null) { + throw new IllegalArgumentException("Parameter localStringPath is required and cannot be null."); + } + if (pathItemStringPath == null) { + throw new IllegalArgumentException("Parameter pathItemStringPath is required and cannot be null."); + } + if (this.client.globalStringPath() == null) { + throw new IllegalArgumentException("Parameter this.client.globalStringPath() is required and cannot be null."); + } + return service.getLocalPathItemQueryNull(localStringPath, pathItemStringPath, this.client.globalStringPath(), localStringQuery, pathItemStringQuery, this.client.globalStringQuery()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLocalPathItemQueryNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLocalPathItemQueryNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/url/implementation/PathsImpl.java b/test/vanilla/src/main/java/fixtures/url/implementation/PathsImpl.java new file mode 100644 index 0000000000..ebe01dd7bd --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/implementation/PathsImpl.java @@ -0,0 +1,1950 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url.implementation; + +import retrofit2.Retrofit; +import fixtures.url.Paths; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.Base64Url; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.url.models.ErrorException; +import fixtures.url.models.UriColor; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import org.apache.commons.codec.binary.Base64; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.joda.time.LocalDate; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Paths. + */ +public class PathsImpl implements Paths { + /** The Retrofit service to perform REST calls. */ + private PathsService service; + /** The service client containing this operation class. */ + private AutoRestUrlTestServiceImpl client; + + /** + * Initializes an instance of Paths. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PathsImpl(Retrofit retrofit, AutoRestUrlTestServiceImpl client) { + this.service = retrofit.create(PathsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Paths to be + * used by Retrofit to perform actually REST calls. + */ + interface PathsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths getBooleanTrue" }) + @GET("paths/bool/true/{boolPath}") + Observable> getBooleanTrue(@Path("boolPath") boolean boolPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths getBooleanFalse" }) + @GET("paths/bool/false/{boolPath}") + Observable> getBooleanFalse(@Path("boolPath") boolean boolPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths getIntOneMillion" }) + @GET("paths/int/1000000/{intPath}") + Observable> getIntOneMillion(@Path("intPath") int intPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths getIntNegativeOneMillion" }) + @GET("paths/int/-1000000/{intPath}") + Observable> getIntNegativeOneMillion(@Path("intPath") int intPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths getTenBillion" }) + @GET("paths/long/10000000000/{longPath}") + Observable> getTenBillion(@Path("longPath") long longPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths getNegativeTenBillion" }) + @GET("paths/long/-10000000000/{longPath}") + Observable> getNegativeTenBillion(@Path("longPath") long longPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths floatScientificPositive" }) + @GET("paths/float/1.034E+20/{floatPath}") + Observable> floatScientificPositive(@Path("floatPath") double floatPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths floatScientificNegative" }) + @GET("paths/float/-1.034E-20/{floatPath}") + Observable> floatScientificNegative(@Path("floatPath") double floatPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths doubleDecimalPositive" }) + @GET("paths/double/9999999.999/{doublePath}") + Observable> doubleDecimalPositive(@Path("doublePath") double doublePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths doubleDecimalNegative" }) + @GET("paths/double/-9999999.999/{doublePath}") + Observable> doubleDecimalNegative(@Path("doublePath") double doublePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths stringUnicode" }) + @GET("paths/string/unicode/{stringPath}") + Observable> stringUnicode(@Path("stringPath") String stringPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths stringUrlEncoded" }) + @GET("paths/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend/{stringPath}") + Observable> stringUrlEncoded(@Path("stringPath") String stringPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths stringEmpty" }) + @GET("paths/string/empty/{stringPath}") + Observable> stringEmpty(@Path("stringPath") String stringPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths stringNull" }) + @GET("paths/string/null/{stringPath}") + Observable> stringNull(@Path("stringPath") String stringPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths enumValid" }) + @GET("paths/enum/green%20color/{enumPath}") + Observable> enumValid(@Path("enumPath") UriColor enumPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths enumNull" }) + @GET("paths/string/null/{enumPath}") + Observable> enumNull(@Path("enumPath") UriColor enumPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths byteMultiByte" }) + @GET("paths/byte/multibyte/{bytePath}") + Observable> byteMultiByte(@Path("bytePath") String bytePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths byteEmpty" }) + @GET("paths/byte/empty/{bytePath}") + Observable> byteEmpty(@Path("bytePath") String bytePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths byteNull" }) + @GET("paths/byte/null/{bytePath}") + Observable> byteNull(@Path("bytePath") String bytePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths dateValid" }) + @GET("paths/date/2012-01-01/{datePath}") + Observable> dateValid(@Path("datePath") LocalDate datePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths dateNull" }) + @GET("paths/date/null/{datePath}") + Observable> dateNull(@Path("datePath") LocalDate datePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths dateTimeValid" }) + @GET("paths/datetime/2012-01-01T01%3A01%3A01Z/{dateTimePath}") + Observable> dateTimeValid(@Path("dateTimePath") DateTime dateTimePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths dateTimeNull" }) + @GET("paths/datetime/null/{dateTimePath}") + Observable> dateTimeNull(@Path("dateTimePath") DateTime dateTimePath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths base64Url" }) + @GET("paths/string/bG9yZW0/{base64UrlPath}") + Observable> base64Url(@Path("base64UrlPath") Base64Url base64UrlPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths arrayCsvInPath" }) + @GET("paths/array/ArrayPath1%2cbegin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend%2c%2c/{arrayPath}") + Observable> arrayCsvInPath(@Path("arrayPath") String arrayPath); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Paths unixTimeUrl" }) + @GET("paths/int/1460505600/{unixTimeUrlPath}") + Observable> unixTimeUrl(@Path("unixTimeUrlPath") long unixTimeUrlPath); + + } + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getBooleanTrue() { + getBooleanTrueWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get true Boolean value on path. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBooleanTrueAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBooleanTrueWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getBooleanTrueAsync() { + return getBooleanTrueWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getBooleanTrueWithServiceResponseAsync() { + final boolean boolPath = true; + return service.getBooleanTrue(boolPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBooleanTrueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBooleanTrueDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getBooleanFalse() { + getBooleanFalseWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get false Boolean value on path. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBooleanFalseAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBooleanFalseWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getBooleanFalseAsync() { + return getBooleanFalseWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getBooleanFalseWithServiceResponseAsync() { + final boolean boolPath = false; + return service.getBooleanFalse(boolPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBooleanFalseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBooleanFalseDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getIntOneMillion() { + getIntOneMillionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '1000000' integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIntOneMillionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIntOneMillionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getIntOneMillionAsync() { + return getIntOneMillionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getIntOneMillionWithServiceResponseAsync() { + final int intPath = 1000000; + return service.getIntOneMillion(intPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIntOneMillionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIntOneMillionDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getIntNegativeOneMillion() { + getIntNegativeOneMillionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '-1000000' integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIntNegativeOneMillionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIntNegativeOneMillionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getIntNegativeOneMillionAsync() { + return getIntNegativeOneMillionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getIntNegativeOneMillionWithServiceResponseAsync() { + final int intPath = -1000000; + return service.getIntNegativeOneMillion(intPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIntNegativeOneMillionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIntNegativeOneMillionDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getTenBillion() { + getTenBillionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '10000000000' 64 bit integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTenBillionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTenBillionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getTenBillionAsync() { + return getTenBillionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getTenBillionWithServiceResponseAsync() { + final long longPath = 10000000000L; + return service.getTenBillion(longPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTenBillionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTenBillionDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getNegativeTenBillion() { + getNegativeTenBillionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '-10000000000' 64 bit integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNegativeTenBillionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNegativeTenBillionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getNegativeTenBillionAsync() { + return getNegativeTenBillionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getNegativeTenBillionWithServiceResponseAsync() { + final long longPath = -10000000000L; + return service.getNegativeTenBillion(longPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNegativeTenBillionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNegativeTenBillionDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void floatScientificPositive() { + floatScientificPositiveWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '1.034E+20' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture floatScientificPositiveAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(floatScientificPositiveWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable floatScientificPositiveAsync() { + return floatScientificPositiveWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> floatScientificPositiveWithServiceResponseAsync() { + final double floatPath = 1.034E+20; + return service.floatScientificPositive(floatPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = floatScientificPositiveDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse floatScientificPositiveDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void floatScientificNegative() { + floatScientificNegativeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '-1.034E-20' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture floatScientificNegativeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(floatScientificNegativeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable floatScientificNegativeAsync() { + return floatScientificNegativeWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> floatScientificNegativeWithServiceResponseAsync() { + final double floatPath = -1.034E-20; + return service.floatScientificNegative(floatPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = floatScientificNegativeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse floatScientificNegativeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void doubleDecimalPositive() { + doubleDecimalPositiveWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '9999999.999' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture doubleDecimalPositiveAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(doubleDecimalPositiveWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable doubleDecimalPositiveAsync() { + return doubleDecimalPositiveWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> doubleDecimalPositiveWithServiceResponseAsync() { + final double doublePath = 9999999.999; + return service.doubleDecimalPositive(doublePath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = doubleDecimalPositiveDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse doubleDecimalPositiveDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void doubleDecimalNegative() { + doubleDecimalNegativeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '-9999999.999' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture doubleDecimalNegativeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(doubleDecimalNegativeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable doubleDecimalNegativeAsync() { + return doubleDecimalNegativeWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> doubleDecimalNegativeWithServiceResponseAsync() { + final double doublePath = -9999999.999; + return service.doubleDecimalNegative(doublePath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = doubleDecimalNegativeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse doubleDecimalNegativeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringUnicode() { + stringUnicodeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringUnicodeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringUnicodeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringUnicodeAsync() { + return stringUnicodeWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringUnicodeWithServiceResponseAsync() { + final String stringPath = "啊齄丂狛狜隣郎隣兀﨩"; + return service.stringUnicode(stringPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringUnicodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stringUnicodeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringUrlEncoded() { + stringUrlEncodedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringUrlEncodedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringUrlEncodedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringUrlEncodedAsync() { + return stringUrlEncodedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringUrlEncodedWithServiceResponseAsync() { + final String stringPath = "begin!*'();:@ &=+$,/?#[]end"; + return service.stringUrlEncoded(stringPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringUrlEncodedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stringUrlEncodedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringEmpty() { + stringEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get ''. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringEmptyAsync() { + return stringEmptyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringEmptyWithServiceResponseAsync() { + final String stringPath = ""; + return service.stringEmpty(stringPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stringEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null (should throw). + * + * @param stringPath null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringNull(String stringPath) { + stringNullWithServiceResponseAsync(stringPath).toBlocking().single().body(); + } + + /** + * Get null (should throw). + * + * @param stringPath null string value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringNullAsync(String stringPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringNullWithServiceResponseAsync(stringPath), serviceCallback); + } + + /** + * Get null (should throw). + * + * @param stringPath null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringNullAsync(String stringPath) { + return stringNullWithServiceResponseAsync(stringPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null (should throw). + * + * @param stringPath null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringNullWithServiceResponseAsync(String stringPath) { + if (stringPath == null) { + throw new IllegalArgumentException("Parameter stringPath is required and cannot be null."); + } + return service.stringNull(stringPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stringNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(400, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get using uri with 'green color' in path parameter. + * + * @param enumPath send the value green. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enumValid(UriColor enumPath) { + enumValidWithServiceResponseAsync(enumPath).toBlocking().single().body(); + } + + /** + * Get using uri with 'green color' in path parameter. + * + * @param enumPath send the value green. Possible values include: 'red color', 'green color', 'blue color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enumValidAsync(UriColor enumPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enumValidWithServiceResponseAsync(enumPath), serviceCallback); + } + + /** + * Get using uri with 'green color' in path parameter. + * + * @param enumPath send the value green. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enumValidAsync(UriColor enumPath) { + return enumValidWithServiceResponseAsync(enumPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get using uri with 'green color' in path parameter. + * + * @param enumPath send the value green. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enumValidWithServiceResponseAsync(UriColor enumPath) { + if (enumPath == null) { + throw new IllegalArgumentException("Parameter enumPath is required and cannot be null."); + } + return service.enumValid(enumPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enumValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enumValidDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null (should throw on the client before the request is sent on wire). + * + * @param enumPath send null should throw. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enumNull(UriColor enumPath) { + enumNullWithServiceResponseAsync(enumPath).toBlocking().single().body(); + } + + /** + * Get null (should throw on the client before the request is sent on wire). + * + * @param enumPath send null should throw. Possible values include: 'red color', 'green color', 'blue color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enumNullAsync(UriColor enumPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enumNullWithServiceResponseAsync(enumPath), serviceCallback); + } + + /** + * Get null (should throw on the client before the request is sent on wire). + * + * @param enumPath send null should throw. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enumNullAsync(UriColor enumPath) { + return enumNullWithServiceResponseAsync(enumPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null (should throw on the client before the request is sent on wire). + * + * @param enumPath send null should throw. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enumNullWithServiceResponseAsync(UriColor enumPath) { + if (enumPath == null) { + throw new IllegalArgumentException("Parameter enumPath is required and cannot be null."); + } + return service.enumNull(enumPath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enumNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enumNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(400, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param bytePath '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void byteMultiByte(byte[] bytePath) { + byteMultiByteWithServiceResponseAsync(bytePath).toBlocking().single().body(); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param bytePath '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture byteMultiByteAsync(byte[] bytePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(byteMultiByteWithServiceResponseAsync(bytePath), serviceCallback); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param bytePath '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable byteMultiByteAsync(byte[] bytePath) { + return byteMultiByteWithServiceResponseAsync(bytePath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param bytePath '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> byteMultiByteWithServiceResponseAsync(byte[] bytePath) { + if (bytePath == null) { + throw new IllegalArgumentException("Parameter bytePath is required and cannot be null."); + } + String bytePathConverted = Base64.encodeBase64String(bytePath); + return service.byteMultiByte(bytePathConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = byteMultiByteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse byteMultiByteDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void byteEmpty() { + byteEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '' as byte array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture byteEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(byteEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable byteEmptyAsync() { + return byteEmptyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> byteEmptyWithServiceResponseAsync() { + final byte[] bytePath = "".getBytes(); + String bytePathConverted = Base64.encodeBase64String(bytePath); + return service.byteEmpty(bytePathConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = byteEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse byteEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null as byte array (should throw). + * + * @param bytePath null as byte array (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void byteNull(byte[] bytePath) { + byteNullWithServiceResponseAsync(bytePath).toBlocking().single().body(); + } + + /** + * Get null as byte array (should throw). + * + * @param bytePath null as byte array (should throw) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture byteNullAsync(byte[] bytePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(byteNullWithServiceResponseAsync(bytePath), serviceCallback); + } + + /** + * Get null as byte array (should throw). + * + * @param bytePath null as byte array (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable byteNullAsync(byte[] bytePath) { + return byteNullWithServiceResponseAsync(bytePath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as byte array (should throw). + * + * @param bytePath null as byte array (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> byteNullWithServiceResponseAsync(byte[] bytePath) { + if (bytePath == null) { + throw new IllegalArgumentException("Parameter bytePath is required and cannot be null."); + } + String bytePathConverted = Base64.encodeBase64String(bytePath); + return service.byteNull(bytePathConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = byteNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse byteNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(400, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateValid() { + dateValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '2012-01-01' as date. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateValidAsync() { + return dateValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateValidWithServiceResponseAsync() { + final LocalDate datePath = LocalDate.parse("2012-01-01"); + return service.dateValid(datePath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dateValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null as date - this should throw or be unusable on the client side, depending on date representation. + * + * @param datePath null as date (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateNull(LocalDate datePath) { + dateNullWithServiceResponseAsync(datePath).toBlocking().single().body(); + } + + /** + * Get null as date - this should throw or be unusable on the client side, depending on date representation. + * + * @param datePath null as date (should throw) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateNullAsync(LocalDate datePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateNullWithServiceResponseAsync(datePath), serviceCallback); + } + + /** + * Get null as date - this should throw or be unusable on the client side, depending on date representation. + * + * @param datePath null as date (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateNullAsync(LocalDate datePath) { + return dateNullWithServiceResponseAsync(datePath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as date - this should throw or be unusable on the client side, depending on date representation. + * + * @param datePath null as date (should throw) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateNullWithServiceResponseAsync(LocalDate datePath) { + if (datePath == null) { + throw new IllegalArgumentException("Parameter datePath is required and cannot be null."); + } + return service.dateNull(datePath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dateNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(400, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateTimeValid() { + dateTimeValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateTimeValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateTimeValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateTimeValidAsync() { + return dateTimeValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateTimeValidWithServiceResponseAsync() { + final DateTime dateTimePath = DateTime.parse("2012-01-01T01:01:01Z"); + return service.dateTimeValid(dateTimePath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateTimeValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dateTimeValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null as date-time, should be disallowed or throw depending on representation of date-time. + * + * @param dateTimePath null as date-time + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateTimeNull(DateTime dateTimePath) { + dateTimeNullWithServiceResponseAsync(dateTimePath).toBlocking().single().body(); + } + + /** + * Get null as date-time, should be disallowed or throw depending on representation of date-time. + * + * @param dateTimePath null as date-time + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateTimeNullAsync(DateTime dateTimePath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateTimeNullWithServiceResponseAsync(dateTimePath), serviceCallback); + } + + /** + * Get null as date-time, should be disallowed or throw depending on representation of date-time. + * + * @param dateTimePath null as date-time + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateTimeNullAsync(DateTime dateTimePath) { + return dateTimeNullWithServiceResponseAsync(dateTimePath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as date-time, should be disallowed or throw depending on representation of date-time. + * + * @param dateTimePath null as date-time + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateTimeNullWithServiceResponseAsync(DateTime dateTimePath) { + if (dateTimePath == null) { + throw new IllegalArgumentException("Parameter dateTimePath is required and cannot be null."); + } + return service.dateTimeNull(dateTimePath) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateTimeNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dateTimeNullDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(400, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get 'lorem' encoded value as 'bG9yZW0' (base64url). + * + * @param base64UrlPath base64url encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void base64Url(byte[] base64UrlPath) { + base64UrlWithServiceResponseAsync(base64UrlPath).toBlocking().single().body(); + } + + /** + * Get 'lorem' encoded value as 'bG9yZW0' (base64url). + * + * @param base64UrlPath base64url encoded value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture base64UrlAsync(byte[] base64UrlPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(base64UrlWithServiceResponseAsync(base64UrlPath), serviceCallback); + } + + /** + * Get 'lorem' encoded value as 'bG9yZW0' (base64url). + * + * @param base64UrlPath base64url encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable base64UrlAsync(byte[] base64UrlPath) { + return base64UrlWithServiceResponseAsync(base64UrlPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 'lorem' encoded value as 'bG9yZW0' (base64url). + * + * @param base64UrlPath base64url encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> base64UrlWithServiceResponseAsync(byte[] base64UrlPath) { + if (base64UrlPath == null) { + throw new IllegalArgumentException("Parameter base64UrlPath is required and cannot be null."); + } + Base64Url base64UrlPathConverted = Base64Url.encode(base64UrlPath); + return service.base64Url(base64UrlPathConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = base64UrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse base64UrlDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayPath an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayCsvInPath(List arrayPath) { + arrayCsvInPathWithServiceResponseAsync(arrayPath).toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayPath an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayCsvInPathAsync(List arrayPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayCsvInPathWithServiceResponseAsync(arrayPath), serviceCallback); + } + + /** + * Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayPath an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayCsvInPathAsync(List arrayPath) { + return arrayCsvInPathWithServiceResponseAsync(arrayPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayPath an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayCsvInPathWithServiceResponseAsync(List arrayPath) { + if (arrayPath == null) { + throw new IllegalArgumentException("Parameter arrayPath is required and cannot be null."); + } + Validator.validate(arrayPath); + String arrayPathConverted = this.client.serializerAdapter().serializeList(arrayPath, CollectionFormat.CSV); + return service.arrayCsvInPath(arrayPathConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayCsvInPathDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse arrayCsvInPathDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void unixTimeUrl(DateTime unixTimeUrlPath) { + unixTimeUrlWithServiceResponseAsync(unixTimeUrlPath).toBlocking().single().body(); + } + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture unixTimeUrlAsync(DateTime unixTimeUrlPath, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(unixTimeUrlWithServiceResponseAsync(unixTimeUrlPath), serviceCallback); + } + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable unixTimeUrlAsync(DateTime unixTimeUrlPath) { + return unixTimeUrlWithServiceResponseAsync(unixTimeUrlPath).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the date 2016-04-13 encoded value as '1460505600' (Unix time). + * + * @param unixTimeUrlPath Unix time encoded value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> unixTimeUrlWithServiceResponseAsync(DateTime unixTimeUrlPath) { + Long unixTimeUrlPathConverted = unixTimeUrlPath.toDateTime(DateTimeZone.UTC).getMillis() / 1000; + return service.unixTimeUrl(unixTimeUrlPathConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = unixTimeUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse unixTimeUrlDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/url/implementation/QueriesImpl.java b/test/vanilla/src/main/java/fixtures/url/implementation/QueriesImpl.java new file mode 100644 index 0000000000..6048db0eac --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/implementation/QueriesImpl.java @@ -0,0 +1,3583 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url.implementation; + +import retrofit2.Retrofit; +import fixtures.url.Queries; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.CollectionFormat; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.url.models.ErrorException; +import fixtures.url.models.UriColor; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import org.apache.commons.codec.binary.Base64; +import org.joda.time.DateTime; +import org.joda.time.LocalDate; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Queries. + */ +public class QueriesImpl implements Queries { + /** The Retrofit service to perform REST calls. */ + private QueriesService service; + /** The service client containing this operation class. */ + private AutoRestUrlTestServiceImpl client; + + /** + * Initializes an instance of Queries. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QueriesImpl(Retrofit retrofit, AutoRestUrlTestServiceImpl client) { + this.service = retrofit.create(QueriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Queries to be + * used by Retrofit to perform actually REST calls. + */ + interface QueriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getBooleanTrue" }) + @GET("queries/bool/true") + Observable> getBooleanTrue(@Query("boolQuery") boolean boolQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getBooleanFalse" }) + @GET("queries/bool/false") + Observable> getBooleanFalse(@Query("boolQuery") boolean boolQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getBooleanNull" }) + @GET("queries/bool/null") + Observable> getBooleanNull(@Query("boolQuery") Boolean boolQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getIntOneMillion" }) + @GET("queries/int/1000000") + Observable> getIntOneMillion(@Query("intQuery") int intQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getIntNegativeOneMillion" }) + @GET("queries/int/-1000000") + Observable> getIntNegativeOneMillion(@Query("intQuery") int intQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getIntNull" }) + @GET("queries/int/null") + Observable> getIntNull(@Query("intQuery") Integer intQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getTenBillion" }) + @GET("queries/long/10000000000") + Observable> getTenBillion(@Query("longQuery") long longQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getNegativeTenBillion" }) + @GET("queries/long/-10000000000") + Observable> getNegativeTenBillion(@Query("longQuery") long longQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries getLongNull" }) + @GET("queries/long/null") + Observable> getLongNull(@Query("longQuery") Long longQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries floatScientificPositive" }) + @GET("queries/float/1.034E+20") + Observable> floatScientificPositive(@Query("floatQuery") double floatQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries floatScientificNegative" }) + @GET("queries/float/-1.034E-20") + Observable> floatScientificNegative(@Query("floatQuery") double floatQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries floatNull" }) + @GET("queries/float/null") + Observable> floatNull(@Query("floatQuery") Double floatQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries doubleDecimalPositive" }) + @GET("queries/double/9999999.999") + Observable> doubleDecimalPositive(@Query("doubleQuery") double doubleQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries doubleDecimalNegative" }) + @GET("queries/double/-9999999.999") + Observable> doubleDecimalNegative(@Query("doubleQuery") double doubleQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries doubleNull" }) + @GET("queries/double/null") + Observable> doubleNull(@Query("doubleQuery") Double doubleQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries stringUnicode" }) + @GET("queries/string/unicode/") + Observable> stringUnicode(@Query("stringQuery") String stringQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries stringUrlEncoded" }) + @GET("queries/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend") + Observable> stringUrlEncoded(@Query("stringQuery") String stringQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries stringEmpty" }) + @GET("queries/string/empty") + Observable> stringEmpty(@Query("stringQuery") String stringQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries stringNull" }) + @GET("queries/string/null") + Observable> stringNull(@Query("stringQuery") String stringQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries enumValid" }) + @GET("queries/enum/green%20color") + Observable> enumValid(@Query("enumQuery") UriColor enumQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries enumNull" }) + @GET("queries/enum/null") + Observable> enumNull(@Query("enumQuery") UriColor enumQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries byteMultiByte" }) + @GET("queries/byte/multibyte") + Observable> byteMultiByte(@Query("byteQuery") String byteQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries byteEmpty" }) + @GET("queries/byte/empty") + Observable> byteEmpty(@Query("byteQuery") String byteQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries byteNull" }) + @GET("queries/byte/null") + Observable> byteNull(@Query("byteQuery") String byteQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries dateValid" }) + @GET("queries/date/2012-01-01") + Observable> dateValid(@Query("dateQuery") LocalDate dateQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries dateNull" }) + @GET("queries/date/null") + Observable> dateNull(@Query("dateQuery") LocalDate dateQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries dateTimeValid" }) + @GET("queries/datetime/2012-01-01T01%3A01%3A01Z") + Observable> dateTimeValid(@Query("dateTimeQuery") DateTime dateTimeQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries dateTimeNull" }) + @GET("queries/datetime/null") + Observable> dateTimeNull(@Query("dateTimeQuery") DateTime dateTimeQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries arrayStringCsvValid" }) + @GET("queries/array/csv/string/valid") + Observable> arrayStringCsvValid(@Query("arrayQuery") String arrayQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries arrayStringCsvNull" }) + @GET("queries/array/csv/string/null") + Observable> arrayStringCsvNull(@Query("arrayQuery") String arrayQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries arrayStringCsvEmpty" }) + @GET("queries/array/csv/string/empty") + Observable> arrayStringCsvEmpty(@Query("arrayQuery") String arrayQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries arrayStringSsvValid" }) + @GET("queries/array/ssv/string/valid") + Observable> arrayStringSsvValid(@Query("arrayQuery") String arrayQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries arrayStringTsvValid" }) + @GET("queries/array/tsv/string/valid") + Observable> arrayStringTsvValid(@Query("arrayQuery") String arrayQuery); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.url.Queries arrayStringPipesValid" }) + @GET("queries/array/pipes/string/valid") + Observable> arrayStringPipesValid(@Query("arrayQuery") String arrayQuery); + + } + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getBooleanTrue() { + getBooleanTrueWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get true Boolean value on path. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBooleanTrueAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBooleanTrueWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getBooleanTrueAsync() { + return getBooleanTrueWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get true Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getBooleanTrueWithServiceResponseAsync() { + final boolean boolQuery = true; + return service.getBooleanTrue(boolQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBooleanTrueDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBooleanTrueDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getBooleanFalse() { + getBooleanFalseWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get false Boolean value on path. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBooleanFalseAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBooleanFalseWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getBooleanFalseAsync() { + return getBooleanFalseWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get false Boolean value on path. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getBooleanFalseWithServiceResponseAsync() { + final boolean boolQuery = false; + return service.getBooleanFalse(boolQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBooleanFalseDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBooleanFalseDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null Boolean value on query (query string should be absent). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getBooleanNull() { + getBooleanNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBooleanNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBooleanNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null Boolean value on query (query string should be absent). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getBooleanNullAsync() { + return getBooleanNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null Boolean value on query (query string should be absent). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getBooleanNullWithServiceResponseAsync() { + final Boolean boolQuery = null; + return service.getBooleanNull(boolQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBooleanNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param boolQuery null boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getBooleanNull(Boolean boolQuery) { + getBooleanNullWithServiceResponseAsync(boolQuery).toBlocking().single().body(); + } + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param boolQuery null boolean value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getBooleanNullAsync(Boolean boolQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBooleanNullWithServiceResponseAsync(boolQuery), serviceCallback); + } + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param boolQuery null boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getBooleanNullAsync(Boolean boolQuery) { + return getBooleanNullWithServiceResponseAsync(boolQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null Boolean value on query (query string should be absent). + * + * @param boolQuery null boolean value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getBooleanNullWithServiceResponseAsync(Boolean boolQuery) { + return service.getBooleanNull(boolQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBooleanNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBooleanNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getIntOneMillion() { + getIntOneMillionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '1000000' integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIntOneMillionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIntOneMillionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getIntOneMillionAsync() { + return getIntOneMillionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getIntOneMillionWithServiceResponseAsync() { + final int intQuery = 1000000; + return service.getIntOneMillion(intQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIntOneMillionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIntOneMillionDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getIntNegativeOneMillion() { + getIntNegativeOneMillionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '-1000000' integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIntNegativeOneMillionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIntNegativeOneMillionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getIntNegativeOneMillionAsync() { + return getIntNegativeOneMillionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '-1000000' integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getIntNegativeOneMillionWithServiceResponseAsync() { + final int intQuery = -1000000; + return service.getIntNegativeOneMillion(intQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIntNegativeOneMillionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIntNegativeOneMillionDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null integer value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getIntNull() { + getIntNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null integer value (no query parameter). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIntNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIntNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null integer value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getIntNullAsync() { + return getIntNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null integer value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getIntNullWithServiceResponseAsync() { + final Integer intQuery = null; + return service.getIntNull(intQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIntNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null integer value (no query parameter). + * + * @param intQuery null integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getIntNull(Integer intQuery) { + getIntNullWithServiceResponseAsync(intQuery).toBlocking().single().body(); + } + + /** + * Get null integer value (no query parameter). + * + * @param intQuery null integer value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getIntNullAsync(Integer intQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getIntNullWithServiceResponseAsync(intQuery), serviceCallback); + } + + /** + * Get null integer value (no query parameter). + * + * @param intQuery null integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getIntNullAsync(Integer intQuery) { + return getIntNullWithServiceResponseAsync(intQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null integer value (no query parameter). + * + * @param intQuery null integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getIntNullWithServiceResponseAsync(Integer intQuery) { + return service.getIntNull(intQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getIntNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getIntNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getTenBillion() { + getTenBillionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '10000000000' 64 bit integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getTenBillionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getTenBillionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getTenBillionAsync() { + return getTenBillionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getTenBillionWithServiceResponseAsync() { + final long longQuery = 10000000000L; + return service.getTenBillion(longQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getTenBillionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getTenBillionDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getNegativeTenBillion() { + getNegativeTenBillionWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '-10000000000' 64 bit integer value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getNegativeTenBillionAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getNegativeTenBillionWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getNegativeTenBillionAsync() { + return getNegativeTenBillionWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '-10000000000' 64 bit integer value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getNegativeTenBillionWithServiceResponseAsync() { + final long longQuery = -10000000000L; + return service.getNegativeTenBillion(longQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getNegativeTenBillionDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getNegativeTenBillionDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getLongNull() { + getLongNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLongNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLongNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getLongNullAsync() { + return getLongNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getLongNullWithServiceResponseAsync() { + final Long longQuery = null; + return service.getLongNull(longQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLongNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param longQuery null 64 bit integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getLongNull(Long longQuery) { + getLongNullWithServiceResponseAsync(longQuery).toBlocking().single().body(); + } + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param longQuery null 64 bit integer value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getLongNullAsync(Long longQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLongNullWithServiceResponseAsync(longQuery), serviceCallback); + } + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param longQuery null 64 bit integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getLongNullAsync(Long longQuery) { + return getLongNullWithServiceResponseAsync(longQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 'null 64 bit integer value (no query param in uri). + * + * @param longQuery null 64 bit integer value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getLongNullWithServiceResponseAsync(Long longQuery) { + return service.getLongNull(longQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLongNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLongNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void floatScientificPositive() { + floatScientificPositiveWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '1.034E+20' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture floatScientificPositiveAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(floatScientificPositiveWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable floatScientificPositiveAsync() { + return floatScientificPositiveWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '1.034E+20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> floatScientificPositiveWithServiceResponseAsync() { + final double floatQuery = 1.034E+20; + return service.floatScientificPositive(floatQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = floatScientificPositiveDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse floatScientificPositiveDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void floatScientificNegative() { + floatScientificNegativeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '-1.034E-20' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture floatScientificNegativeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(floatScientificNegativeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable floatScientificNegativeAsync() { + return floatScientificNegativeWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '-1.034E-20' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> floatScientificNegativeWithServiceResponseAsync() { + final double floatQuery = -1.034E-20; + return service.floatScientificNegative(floatQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = floatScientificNegativeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse floatScientificNegativeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void floatNull() { + floatNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null numeric value (no query parameter). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture floatNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(floatNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable floatNullAsync() { + return floatNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> floatNullWithServiceResponseAsync() { + final Double floatQuery = null; + return service.floatNull(floatQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = floatNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null numeric value (no query parameter). + * + * @param floatQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void floatNull(Double floatQuery) { + floatNullWithServiceResponseAsync(floatQuery).toBlocking().single().body(); + } + + /** + * Get null numeric value (no query parameter). + * + * @param floatQuery null numeric value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture floatNullAsync(Double floatQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(floatNullWithServiceResponseAsync(floatQuery), serviceCallback); + } + + /** + * Get null numeric value (no query parameter). + * + * @param floatQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable floatNullAsync(Double floatQuery) { + return floatNullWithServiceResponseAsync(floatQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null numeric value (no query parameter). + * + * @param floatQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> floatNullWithServiceResponseAsync(Double floatQuery) { + return service.floatNull(floatQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = floatNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse floatNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void doubleDecimalPositive() { + doubleDecimalPositiveWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '9999999.999' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture doubleDecimalPositiveAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(doubleDecimalPositiveWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable doubleDecimalPositiveAsync() { + return doubleDecimalPositiveWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> doubleDecimalPositiveWithServiceResponseAsync() { + final double doubleQuery = 9999999.999; + return service.doubleDecimalPositive(doubleQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = doubleDecimalPositiveDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse doubleDecimalPositiveDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void doubleDecimalNegative() { + doubleDecimalNegativeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '-9999999.999' numeric value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture doubleDecimalNegativeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(doubleDecimalNegativeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable doubleDecimalNegativeAsync() { + return doubleDecimalNegativeWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '-9999999.999' numeric value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> doubleDecimalNegativeWithServiceResponseAsync() { + final double doubleQuery = -9999999.999; + return service.doubleDecimalNegative(doubleQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = doubleDecimalNegativeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse doubleDecimalNegativeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void doubleNull() { + doubleNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null numeric value (no query parameter). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture doubleNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(doubleNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable doubleNullAsync() { + return doubleNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null numeric value (no query parameter). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> doubleNullWithServiceResponseAsync() { + final Double doubleQuery = null; + return service.doubleNull(doubleQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = doubleNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null numeric value (no query parameter). + * + * @param doubleQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void doubleNull(Double doubleQuery) { + doubleNullWithServiceResponseAsync(doubleQuery).toBlocking().single().body(); + } + + /** + * Get null numeric value (no query parameter). + * + * @param doubleQuery null numeric value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture doubleNullAsync(Double doubleQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(doubleNullWithServiceResponseAsync(doubleQuery), serviceCallback); + } + + /** + * Get null numeric value (no query parameter). + * + * @param doubleQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable doubleNullAsync(Double doubleQuery) { + return doubleNullWithServiceResponseAsync(doubleQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null numeric value (no query parameter). + * + * @param doubleQuery null numeric value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> doubleNullWithServiceResponseAsync(Double doubleQuery) { + return service.doubleNull(doubleQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = doubleNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse doubleNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringUnicode() { + stringUnicodeWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringUnicodeAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringUnicodeWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringUnicodeAsync() { + return stringUnicodeWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringUnicodeWithServiceResponseAsync() { + final String stringQuery = "啊齄丂狛狜隣郎隣兀﨩"; + return service.stringUnicode(stringQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringUnicodeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stringUnicodeDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringUrlEncoded() { + stringUrlEncodedWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringUrlEncodedAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringUrlEncodedWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringUrlEncodedAsync() { + return stringUrlEncodedWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get 'begin!*'();:@ &=+$,/?#[]end. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringUrlEncodedWithServiceResponseAsync() { + final String stringQuery = "begin!*'();:@ &=+$,/?#[]end"; + return service.stringUrlEncoded(stringQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringUrlEncodedDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stringUrlEncodedDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringEmpty() { + stringEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get ''. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringEmptyAsync() { + return stringEmptyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get ''. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringEmptyWithServiceResponseAsync() { + final String stringQuery = ""; + return service.stringEmpty(stringQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stringEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringNull() { + stringNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null (no query parameter in url). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringNullAsync() { + return stringNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringNullWithServiceResponseAsync() { + final String stringQuery = null; + return service.stringNull(stringQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null (no query parameter in url). + * + * @param stringQuery null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stringNull(String stringQuery) { + stringNullWithServiceResponseAsync(stringQuery).toBlocking().single().body(); + } + + /** + * Get null (no query parameter in url). + * + * @param stringQuery null string value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture stringNullAsync(String stringQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stringNullWithServiceResponseAsync(stringQuery), serviceCallback); + } + + /** + * Get null (no query parameter in url). + * + * @param stringQuery null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stringNullAsync(String stringQuery) { + return stringNullWithServiceResponseAsync(stringQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null (no query parameter in url). + * + * @param stringQuery null string value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stringNullWithServiceResponseAsync(String stringQuery) { + return service.stringNull(stringQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stringNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stringNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get using uri with query parameter 'green color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enumValid() { + enumValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get using uri with query parameter 'green color'. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enumValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enumValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get using uri with query parameter 'green color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enumValidAsync() { + return enumValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get using uri with query parameter 'green color'. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enumValidWithServiceResponseAsync() { + final UriColor enumQuery = null; + return service.enumValid(enumQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enumValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get using uri with query parameter 'green color'. + * + * @param enumQuery 'green color' enum value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enumValid(UriColor enumQuery) { + enumValidWithServiceResponseAsync(enumQuery).toBlocking().single().body(); + } + + /** + * Get using uri with query parameter 'green color'. + * + * @param enumQuery 'green color' enum value. Possible values include: 'red color', 'green color', 'blue color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enumValidAsync(UriColor enumQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enumValidWithServiceResponseAsync(enumQuery), serviceCallback); + } + + /** + * Get using uri with query parameter 'green color'. + * + * @param enumQuery 'green color' enum value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enumValidAsync(UriColor enumQuery) { + return enumValidWithServiceResponseAsync(enumQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get using uri with query parameter 'green color'. + * + * @param enumQuery 'green color' enum value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enumValidWithServiceResponseAsync(UriColor enumQuery) { + return service.enumValid(enumQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enumValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enumValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enumNull() { + enumNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null (no query parameter in url). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enumNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enumNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enumNullAsync() { + return enumNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null (no query parameter in url). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enumNullWithServiceResponseAsync() { + final UriColor enumQuery = null; + return service.enumNull(enumQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enumNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null (no query parameter in url). + * + * @param enumQuery null string value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enumNull(UriColor enumQuery) { + enumNullWithServiceResponseAsync(enumQuery).toBlocking().single().body(); + } + + /** + * Get null (no query parameter in url). + * + * @param enumQuery null string value. Possible values include: 'red color', 'green color', 'blue color' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture enumNullAsync(UriColor enumQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enumNullWithServiceResponseAsync(enumQuery), serviceCallback); + } + + /** + * Get null (no query parameter in url). + * + * @param enumQuery null string value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enumNullAsync(UriColor enumQuery) { + return enumNullWithServiceResponseAsync(enumQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null (no query parameter in url). + * + * @param enumQuery null string value. Possible values include: 'red color', 'green color', 'blue color' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enumNullWithServiceResponseAsync(UriColor enumQuery) { + return service.enumNull(enumQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enumNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enumNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void byteMultiByte() { + byteMultiByteWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture byteMultiByteAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(byteMultiByteWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable byteMultiByteAsync() { + return byteMultiByteWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> byteMultiByteWithServiceResponseAsync() { + final byte[] byteQuery = new byte[0]; + String byteQueryConverted = Base64.encodeBase64String(byteQuery); + return service.byteMultiByte(byteQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = byteMultiByteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param byteQuery '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void byteMultiByte(byte[] byteQuery) { + byteMultiByteWithServiceResponseAsync(byteQuery).toBlocking().single().body(); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param byteQuery '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture byteMultiByteAsync(byte[] byteQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(byteMultiByteWithServiceResponseAsync(byteQuery), serviceCallback); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param byteQuery '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable byteMultiByteAsync(byte[] byteQuery) { + return byteMultiByteWithServiceResponseAsync(byteQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array. + * + * @param byteQuery '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> byteMultiByteWithServiceResponseAsync(byte[] byteQuery) { + String byteQueryConverted = Base64.encodeBase64String(byteQuery); + return service.byteMultiByte(byteQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = byteMultiByteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse byteMultiByteDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void byteEmpty() { + byteEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '' as byte array. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture byteEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(byteEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable byteEmptyAsync() { + return byteEmptyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '' as byte array. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> byteEmptyWithServiceResponseAsync() { + final byte[] byteQuery = "".getBytes(); + String byteQueryConverted = Base64.encodeBase64String(byteQuery); + return service.byteEmpty(byteQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = byteEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse byteEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null as byte array (no query parameters in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void byteNull() { + byteNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null as byte array (no query parameters in uri). + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture byteNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(byteNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null as byte array (no query parameters in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable byteNullAsync() { + return byteNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as byte array (no query parameters in uri). + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> byteNullWithServiceResponseAsync() { + final byte[] byteQuery = new byte[0]; + String byteQueryConverted = Base64.encodeBase64String(byteQuery); + return service.byteNull(byteQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = byteNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null as byte array (no query parameters in uri). + * + * @param byteQuery null as byte array (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void byteNull(byte[] byteQuery) { + byteNullWithServiceResponseAsync(byteQuery).toBlocking().single().body(); + } + + /** + * Get null as byte array (no query parameters in uri). + * + * @param byteQuery null as byte array (no query parameters in uri) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture byteNullAsync(byte[] byteQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(byteNullWithServiceResponseAsync(byteQuery), serviceCallback); + } + + /** + * Get null as byte array (no query parameters in uri). + * + * @param byteQuery null as byte array (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable byteNullAsync(byte[] byteQuery) { + return byteNullWithServiceResponseAsync(byteQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as byte array (no query parameters in uri). + * + * @param byteQuery null as byte array (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> byteNullWithServiceResponseAsync(byte[] byteQuery) { + String byteQueryConverted = Base64.encodeBase64String(byteQuery); + return service.byteNull(byteQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = byteNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse byteNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateValid() { + dateValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '2012-01-01' as date. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateValidAsync() { + return dateValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '2012-01-01' as date. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateValidWithServiceResponseAsync() { + final LocalDate dateQuery = LocalDate.parse("2012-01-01"); + return service.dateValid(dateQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dateValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateNull() { + dateNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateNullAsync() { + return dateNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateNullWithServiceResponseAsync() { + final LocalDate dateQuery = null; + return service.dateNull(dateQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param dateQuery null as date (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateNull(LocalDate dateQuery) { + dateNullWithServiceResponseAsync(dateQuery).toBlocking().single().body(); + } + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param dateQuery null as date (no query parameters in uri) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateNullAsync(LocalDate dateQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateNullWithServiceResponseAsync(dateQuery), serviceCallback); + } + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param dateQuery null as date (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateNullAsync(LocalDate dateQuery) { + return dateNullWithServiceResponseAsync(dateQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as date - this should result in no query parameters in uri. + * + * @param dateQuery null as date (no query parameters in uri) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateNullWithServiceResponseAsync(LocalDate dateQuery) { + return service.dateNull(dateQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dateNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateTimeValid() { + dateTimeValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateTimeValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateTimeValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateTimeValidAsync() { + return dateTimeValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get '2012-01-01T01:01:01Z' as date-time. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateTimeValidWithServiceResponseAsync() { + final DateTime dateTimeQuery = DateTime.parse("2012-01-01T01:01:01Z"); + return service.dateTimeValid(dateTimeQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateTimeValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dateTimeValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateTimeNull() { + dateTimeNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateTimeNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateTimeNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateTimeNullAsync() { + return dateTimeNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateTimeNullWithServiceResponseAsync() { + final DateTime dateTimeQuery = null; + return service.dateTimeNull(dateTimeQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateTimeNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param dateTimeQuery null as date-time (no query parameters) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void dateTimeNull(DateTime dateTimeQuery) { + dateTimeNullWithServiceResponseAsync(dateTimeQuery).toBlocking().single().body(); + } + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param dateTimeQuery null as date-time (no query parameters) + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture dateTimeNullAsync(DateTime dateTimeQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(dateTimeNullWithServiceResponseAsync(dateTimeQuery), serviceCallback); + } + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param dateTimeQuery null as date-time (no query parameters) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable dateTimeNullAsync(DateTime dateTimeQuery) { + return dateTimeNullWithServiceResponseAsync(dateTimeQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get null as date-time, should result in no query parameters in uri. + * + * @param dateTimeQuery null as date-time (no query parameters) + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> dateTimeNullWithServiceResponseAsync(DateTime dateTimeQuery) { + return service.dateTimeNull(dateTimeQuery) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = dateTimeNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse dateTimeNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringCsvValid() { + arrayStringCsvValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringCsvValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringCsvValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringCsvValidAsync() { + return arrayStringCsvValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringCsvValidWithServiceResponseAsync() { + final List arrayQuery = null; + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.CSV); + return service.arrayStringCsvValid(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringCsvValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringCsvValid(List arrayQuery) { + arrayStringCsvValidWithServiceResponseAsync(arrayQuery).toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringCsvValidAsync(List arrayQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringCsvValidWithServiceResponseAsync(arrayQuery), serviceCallback); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringCsvValidAsync(List arrayQuery) { + return arrayStringCsvValidWithServiceResponseAsync(arrayQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringCsvValidWithServiceResponseAsync(List arrayQuery) { + Validator.validate(arrayQuery); + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.CSV); + return service.arrayStringCsvValid(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringCsvValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse arrayStringCsvValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get a null array of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringCsvNull() { + arrayStringCsvNullWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get a null array of string using the csv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringCsvNullAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringCsvNullWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get a null array of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringCsvNullAsync() { + return arrayStringCsvNullWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a null array of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringCsvNullWithServiceResponseAsync() { + final List arrayQuery = null; + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.CSV); + return service.arrayStringCsvNull(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringCsvNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get a null array of string using the csv-array format. + * + * @param arrayQuery a null array of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringCsvNull(List arrayQuery) { + arrayStringCsvNullWithServiceResponseAsync(arrayQuery).toBlocking().single().body(); + } + + /** + * Get a null array of string using the csv-array format. + * + * @param arrayQuery a null array of string using the csv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringCsvNullAsync(List arrayQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringCsvNullWithServiceResponseAsync(arrayQuery), serviceCallback); + } + + /** + * Get a null array of string using the csv-array format. + * + * @param arrayQuery a null array of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringCsvNullAsync(List arrayQuery) { + return arrayStringCsvNullWithServiceResponseAsync(arrayQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get a null array of string using the csv-array format. + * + * @param arrayQuery a null array of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringCsvNullWithServiceResponseAsync(List arrayQuery) { + Validator.validate(arrayQuery); + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.CSV); + return service.arrayStringCsvNull(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringCsvNullDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse arrayStringCsvNullDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an empty array [] of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringCsvEmpty() { + arrayStringCsvEmptyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringCsvEmptyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringCsvEmptyWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an empty array [] of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringCsvEmptyAsync() { + return arrayStringCsvEmptyWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an empty array [] of string using the csv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringCsvEmptyWithServiceResponseAsync() { + final List arrayQuery = null; + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.CSV); + return service.arrayStringCsvEmpty(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringCsvEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param arrayQuery an empty array [] of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringCsvEmpty(List arrayQuery) { + arrayStringCsvEmptyWithServiceResponseAsync(arrayQuery).toBlocking().single().body(); + } + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param arrayQuery an empty array [] of string using the csv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringCsvEmptyAsync(List arrayQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringCsvEmptyWithServiceResponseAsync(arrayQuery), serviceCallback); + } + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param arrayQuery an empty array [] of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringCsvEmptyAsync(List arrayQuery) { + return arrayStringCsvEmptyWithServiceResponseAsync(arrayQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an empty array [] of string using the csv-array format. + * + * @param arrayQuery an empty array [] of string using the csv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringCsvEmptyWithServiceResponseAsync(List arrayQuery) { + Validator.validate(arrayQuery); + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.CSV); + return service.arrayStringCsvEmpty(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringCsvEmptyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse arrayStringCsvEmptyDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringSsvValid() { + arrayStringSsvValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringSsvValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringSsvValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringSsvValidAsync() { + return arrayStringSsvValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringSsvValidWithServiceResponseAsync() { + final List arrayQuery = null; + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.SSV); + return service.arrayStringSsvValid(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringSsvValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringSsvValid(List arrayQuery) { + arrayStringSsvValidWithServiceResponseAsync(arrayQuery).toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringSsvValidAsync(List arrayQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringSsvValidWithServiceResponseAsync(arrayQuery), serviceCallback); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringSsvValidAsync(List arrayQuery) { + return arrayStringSsvValidWithServiceResponseAsync(arrayQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringSsvValidWithServiceResponseAsync(List arrayQuery) { + Validator.validate(arrayQuery); + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.SSV); + return service.arrayStringSsvValid(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringSsvValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse arrayStringSsvValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringTsvValid() { + arrayStringTsvValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringTsvValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringTsvValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringTsvValidAsync() { + return arrayStringTsvValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringTsvValidWithServiceResponseAsync() { + final List arrayQuery = null; + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.TSV); + return service.arrayStringTsvValid(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringTsvValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringTsvValid(List arrayQuery) { + arrayStringTsvValidWithServiceResponseAsync(arrayQuery).toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringTsvValidAsync(List arrayQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringTsvValidWithServiceResponseAsync(arrayQuery), serviceCallback); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringTsvValidAsync(List arrayQuery) { + return arrayStringTsvValidWithServiceResponseAsync(arrayQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringTsvValidWithServiceResponseAsync(List arrayQuery) { + Validator.validate(arrayQuery); + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.TSV); + return service.arrayStringTsvValid(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringTsvValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse arrayStringTsvValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringPipesValid() { + arrayStringPipesValidWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringPipesValidAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringPipesValidWithServiceResponseAsync(), serviceCallback); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringPipesValidAsync() { + return arrayStringPipesValidWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringPipesValidWithServiceResponseAsync() { + final List arrayQuery = null; + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.PIPES); + return service.arrayStringPipesValid(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringPipesValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void arrayStringPipesValid(List arrayQuery) { + arrayStringPipesValidWithServiceResponseAsync(arrayQuery).toBlocking().single().body(); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture arrayStringPipesValidAsync(List arrayQuery, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(arrayStringPipesValidWithServiceResponseAsync(arrayQuery), serviceCallback); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable arrayStringPipesValidAsync(List arrayQuery) { + return arrayStringPipesValidWithServiceResponseAsync(arrayQuery).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format. + * + * @param arrayQuery an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> arrayStringPipesValidWithServiceResponseAsync(List arrayQuery) { + Validator.validate(arrayQuery); + String arrayQueryConverted = this.client.serializerAdapter().serializeList(arrayQuery, CollectionFormat.PIPES); + return service.arrayStringPipesValid(arrayQueryConverted) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = arrayStringPipesValidDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse arrayStringPipesValidDelegate(Response response) throws ErrorException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/url/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/url/implementation/package-info.java new file mode 100644 index 0000000000..729951ad3a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestUrlTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.url.implementation; diff --git a/test/vanilla/src/main/java/fixtures/url/models/Error.java b/test/vanilla/src/main/java/fixtures/url/models/Error.java new file mode 100644 index 0000000000..82246682b0 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/models/Error.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The status property. + */ + @JsonProperty(value = "status") + private Integer status; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the status value. + * + * @return the status value + */ + public Integer status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the Error object itself. + */ + public Error withStatus(Integer status) { + this.status = status; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/url/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/url/models/ErrorException.java new file mode 100644 index 0000000000..893a3eab49 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/url/models/UriColor.java b/test/vanilla/src/main/java/fixtures/url/models/UriColor.java new file mode 100644 index 0000000000..2d5c2a2f24 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/models/UriColor.java @@ -0,0 +1,58 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.url.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for UriColor. + */ +public enum UriColor { + /** Enum value red color. */ + RED_COLOR("red color"), + + /** Enum value green color. */ + GREEN_COLOR("green color"), + + /** Enum value blue color. */ + BLUE_COLOR("blue color"); + + /** The actual serialized value for a UriColor instance. */ + private String value; + + UriColor(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a UriColor instance. + * + * @param value the serialized value to parse. + * @return the parsed UriColor object, or null if unable to parse. + */ + @JsonCreator + public static UriColor fromString(String value) { + UriColor[] items = UriColor.values(); + for (UriColor item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/test/vanilla/src/main/java/fixtures/url/models/package-info.java b/test/vanilla/src/main/java/fixtures/url/models/package-info.java new file mode 100644 index 0000000000..c837fb818a --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestUrlTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.url.models; diff --git a/test/vanilla/src/main/java/fixtures/url/package-info.java b/test/vanilla/src/main/java/fixtures/url/package-info.java new file mode 100644 index 0000000000..c5fd7c2b34 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/url/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestUrlTestService. + * Test Infrastructure for AutoRest. + */ +package fixtures.url; diff --git a/test/vanilla/src/main/java/fixtures/validation/AutoRestValidationTest.java b/test/vanilla/src/main/java/fixtures/validation/AutoRestValidationTest.java new file mode 100644 index 0000000000..e722b247e7 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/AutoRestValidationTest.java @@ -0,0 +1,296 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.validation; + +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import fixtures.validation.models.ErrorException; +import fixtures.validation.models.Product; +import java.io.IOException; +import rx.Observable; +import com.microsoft.rest.RestClient; + +/** + * The interface for AutoRestValidationTest class. + */ +public interface AutoRestValidationTest { + /** + * Gets the REST client. + * + * @return the {@link RestClient} object. + */ + RestClient restClient(); + + /** + * The default base URL. + */ + String DEFAULT_BASE_URL = "http://localhost"; + + /** + * Gets Subscription ID.. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Sets Subscription ID.. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + AutoRestValidationTest withSubscriptionId(String subscriptionId); + + /** + * Gets Required string following pattern \d{2}-\d{2}-\d{4}. + * + * @return the apiVersion value. + */ + String apiVersion(); + + /** + * Sets Required string following pattern \d{2}-\d{2}-\d{4}. + * + * @param apiVersion the apiVersion value. + * @return the service client itself + */ + AutoRestValidationTest withApiVersion(String apiVersion); + + /** + * Validates input parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product validationOfMethodParameters(String resourceGroupName, int id); + + /** + * Validates input parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture validationOfMethodParametersAsync(String resourceGroupName, int id, final ServiceCallback serviceCallback); + + /** + * Validates input parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable validationOfMethodParametersAsync(String resourceGroupName, int id); + + /** + * Validates input parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> validationOfMethodParametersWithServiceResponseAsync(String resourceGroupName, int id); + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product validationOfBody(String resourceGroupName, int id); + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture validationOfBodyAsync(String resourceGroupName, int id, final ServiceCallback serviceCallback); + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable validationOfBodyAsync(String resourceGroupName, int id); + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> validationOfBodyWithServiceResponseAsync(String resourceGroupName, int id); + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product validationOfBody(String resourceGroupName, int id, Product body); + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param body the Product value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture validationOfBodyAsync(String resourceGroupName, int id, Product body, final ServiceCallback serviceCallback); + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable validationOfBodyAsync(String resourceGroupName, int id, Product body); + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> validationOfBodyWithServiceResponseAsync(String resourceGroupName, int id, Product body); + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + void getWithConstantInPath(); + + /** + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture getWithConstantInPathAsync(final ServiceCallback serviceCallback); + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable getWithConstantInPathAsync(); + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + Observable> getWithConstantInPathWithServiceResponseAsync(); + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product postWithConstantInBody(); + + /** + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postWithConstantInBodyAsync(final ServiceCallback serviceCallback); + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable postWithConstantInBodyAsync(); + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> postWithConstantInBodyWithServiceResponseAsync(); + /** + * + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + Product postWithConstantInBody(Product body); + + /** + * + * @param body the Product value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + ServiceFuture postWithConstantInBodyAsync(Product body, final ServiceCallback serviceCallback); + + /** + * + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable postWithConstantInBodyAsync(Product body); + + /** + * + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + Observable> postWithConstantInBodyWithServiceResponseAsync(Product body); + +} diff --git a/test/vanilla/src/main/java/fixtures/validation/implementation/AutoRestValidationTestImpl.java b/test/vanilla/src/main/java/fixtures/validation/implementation/AutoRestValidationTestImpl.java new file mode 100644 index 0000000000..b509983ef1 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/implementation/AutoRestValidationTestImpl.java @@ -0,0 +1,608 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.validation.implementation; + +import fixtures.validation.AutoRestValidationTest; +import com.microsoft.rest.ServiceClient; +import com.microsoft.rest.RestClient; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import fixtures.validation.models.ErrorException; +import fixtures.validation.models.Product; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the AutoRestValidationTest class. + */ +public class AutoRestValidationTestImpl extends ServiceClient implements AutoRestValidationTest { + /** + * The Retrofit service to perform REST calls. + */ + private AutoRestValidationTestService service; + + /** Subscription ID. */ + private String subscriptionId; + + /** + * Gets Subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public AutoRestValidationTestImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Required string following pattern \d{2}-\d{2}-\d{4}. */ + private String apiVersion; + + /** + * Gets Required string following pattern \d{2}-\d{2}-\d{4}. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** + * Sets Required string following pattern \d{2}-\d{2}-\d{4}. + * + * @param apiVersion the apiVersion value. + * @return the service client itself + */ + public AutoRestValidationTestImpl withApiVersion(String apiVersion) { + this.apiVersion = apiVersion; + return this; + } + + /** + * Initializes an instance of AutoRestValidationTest client. + */ + public AutoRestValidationTestImpl() { + this("http://localhost"); + } + + /** + * Initializes an instance of AutoRestValidationTest client. + * + * @param baseUrl the base URL of the host + */ + public AutoRestValidationTestImpl(String baseUrl) { + super(baseUrl); + initialize(); + } + + /** + * Initializes an instance of AutoRestValidationTest client. + * + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestValidationTestImpl(OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + this("http://localhost", clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestValidationTest client. + * + * @param baseUrl the base URL of the host + * @param clientBuilder the builder for building an OkHttp client, bundled with user configurations + * @param restBuilder the builder for building an Retrofit client, bundled with user configurations + */ + public AutoRestValidationTestImpl(String baseUrl, OkHttpClient.Builder clientBuilder, Retrofit.Builder restBuilder) { + super(baseUrl, clientBuilder, restBuilder); + initialize(); + } + + /** + * Initializes an instance of AutoRestValidationTest client. + * + * @param restClient the REST client containing pre-configured settings + */ + public AutoRestValidationTestImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + private void initialize() { + initializeService(); + } + + private void initializeService() { + service = retrofit().create(AutoRestValidationTestService.class); + } + + /** + * The interface defining all the services for AutoRestValidationTest to be + * used by Retrofit to perform actually REST calls. + */ + interface AutoRestValidationTestService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.validation.AutoRestValidationTest validationOfMethodParameters" }) + @GET("fakepath/{subscriptionId}/{resourceGroupName}/{id}") + Observable> validationOfMethodParameters(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("id") int id, @Query("apiVersion") String apiVersion); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.validation.AutoRestValidationTest validationOfBody" }) + @PUT("fakepath/{subscriptionId}/{resourceGroupName}/{id}") + Observable> validationOfBody(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("id") int id, @Body Product body, @Query("apiVersion") String apiVersion); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.validation.AutoRestValidationTest getWithConstantInPath" }) + @GET("validation/constantsInPath/{constantParam}/value") + Observable> getWithConstantInPath(@Path("constantParam") String constantParam); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.validation.AutoRestValidationTest postWithConstantInBody" }) + @POST("validation/constantsInPath/{constantParam}/value") + Observable> postWithConstantInBody(@Path("constantParam") String constantParam, @Body Product body); + + } + + /** + * Validates input parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product validationOfMethodParameters(String resourceGroupName, int id) { + return validationOfMethodParametersWithServiceResponseAsync(resourceGroupName, id).toBlocking().single().body(); + } + + /** + * Validates input parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validationOfMethodParametersAsync(String resourceGroupName, int id, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validationOfMethodParametersWithServiceResponseAsync(resourceGroupName, id), serviceCallback); + } + + /** + * Validates input parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable validationOfMethodParametersAsync(String resourceGroupName, int id) { + return validationOfMethodParametersWithServiceResponseAsync(resourceGroupName, id).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates input parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> validationOfMethodParametersWithServiceResponseAsync(String resourceGroupName, int id) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + return service.validationOfMethodParameters(this.subscriptionId(), resourceGroupName, id, this.apiVersion()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validationOfMethodParametersDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validationOfMethodParametersDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product validationOfBody(String resourceGroupName, int id) { + return validationOfBodyWithServiceResponseAsync(resourceGroupName, id).toBlocking().single().body(); + } + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validationOfBodyAsync(String resourceGroupName, int id, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validationOfBodyWithServiceResponseAsync(resourceGroupName, id), serviceCallback); + } + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable validationOfBodyAsync(String resourceGroupName, int id) { + return validationOfBodyWithServiceResponseAsync(resourceGroupName, id).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> validationOfBodyWithServiceResponseAsync(String resourceGroupName, int id) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + final Product body = null; + return service.validationOfBody(this.subscriptionId(), resourceGroupName, id, body, this.apiVersion()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validationOfBodyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product validationOfBody(String resourceGroupName, int id, Product body) { + return validationOfBodyWithServiceResponseAsync(resourceGroupName, id, body).toBlocking().single().body(); + } + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param body the Product value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture validationOfBodyAsync(String resourceGroupName, int id, Product body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(validationOfBodyWithServiceResponseAsync(resourceGroupName, id, body), serviceCallback); + } + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable validationOfBodyAsync(String resourceGroupName, int id, Product body) { + return validationOfBodyWithServiceResponseAsync(resourceGroupName, id, body).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Validates body parameters on the method. See swagger for details. + * + * @param resourceGroupName Required string between 3 and 10 chars with pattern [a-zA-Z0-9]+. + * @param id Required int multiple of 10 from 100 to 1000. + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> validationOfBodyWithServiceResponseAsync(String resourceGroupName, int id, Product body) { + if (this.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + Validator.validate(body); + return service.validationOfBody(this.subscriptionId(), resourceGroupName, id, body, this.apiVersion()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = validationOfBodyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse validationOfBodyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void getWithConstantInPath() { + getWithConstantInPathWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getWithConstantInPathAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithConstantInPathWithServiceResponseAsync(), serviceCallback); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable getWithConstantInPathAsync() { + return getWithConstantInPathWithServiceResponseAsync().map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> getWithConstantInPathWithServiceResponseAsync() { + final String constantParam = "constant"; + return service.getWithConstantInPath(constantParam) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getWithConstantInPathDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getWithConstantInPathDelegate(Response response) throws RestException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product postWithConstantInBody() { + return postWithConstantInBodyWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postWithConstantInBodyAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postWithConstantInBodyWithServiceResponseAsync(), serviceCallback); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable postWithConstantInBodyAsync() { + return postWithConstantInBodyWithServiceResponseAsync().map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> postWithConstantInBodyWithServiceResponseAsync() { + final String constantParam = "constant"; + final Product body = null; + return service.postWithConstantInBody(constantParam, body) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postWithConstantInBodyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws RestException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the Product object if successful. + */ + public Product postWithConstantInBody(Product body) { + return postWithConstantInBodyWithServiceResponseAsync(body).toBlocking().single().body(); + } + + /** + * + * @param body the Product value + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture postWithConstantInBodyAsync(Product body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(postWithConstantInBodyWithServiceResponseAsync(body), serviceCallback); + } + + /** + * + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable postWithConstantInBodyAsync(Product body) { + return postWithConstantInBodyWithServiceResponseAsync(body).map(new Func1, Product>() { + @Override + public Product call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * + * @param body the Product value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the Product object + */ + public Observable> postWithConstantInBodyWithServiceResponseAsync(Product body) { + Validator.validate(body); + final String constantParam = "constant"; + return service.postWithConstantInBody(constantParam, body) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = postWithConstantInBodyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse postWithConstantInBodyDelegate(Response response) throws RestException, IOException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .build(response); + } + +} diff --git a/test/vanilla/src/main/java/fixtures/validation/implementation/package-info.java b/test/vanilla/src/main/java/fixtures/validation/implementation/package-info.java new file mode 100644 index 0000000000..bb07136d89 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/implementation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the implementation classes for AutoRestValidationTest. + * Test Infrastructure for AutoRest. No server backend exists for these tests. + */ +package fixtures.validation.implementation; diff --git a/test/vanilla/src/main/java/fixtures/validation/models/ChildProduct.java b/test/vanilla/src/main/java/fixtures/validation/models/ChildProduct.java new file mode 100644 index 0000000000..5ef7872bee --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/models/ChildProduct.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.validation.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The product documentation. + */ +public class ChildProduct { + /** + * Constant string. + */ + @JsonProperty(value = "constProperty", required = true) + private String constProperty; + + /** + * Count. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Creates an instance of ChildProduct class. + */ + public ChildProduct() { + constProperty = "constant"; + } + + /** + * Get the constProperty value. + * + * @return the constProperty value + */ + public String constProperty() { + return this.constProperty; + } + + /** + * Set the constProperty value. + * + * @param constProperty the constProperty value to set + * @return the ChildProduct object itself. + */ + public ChildProduct withConstProperty(String constProperty) { + this.constProperty = constProperty; + return this; + } + + /** + * Get the count value. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count value. + * + * @param count the count value to set + * @return the ChildProduct object itself. + */ + public ChildProduct withCount(Integer count) { + this.count = count; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/validation/models/ConstantProduct.java b/test/vanilla/src/main/java/fixtures/validation/models/ConstantProduct.java new file mode 100644 index 0000000000..8b5141324c --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/models/ConstantProduct.java @@ -0,0 +1,79 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.validation.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The product documentation. + */ +public class ConstantProduct { + /** + * Constant string. + */ + @JsonProperty(value = "constProperty", required = true) + private String constProperty; + + /** + * Constant string2. + */ + @JsonProperty(value = "constProperty2", required = true) + private String constProperty2; + + /** + * Creates an instance of ConstantProduct class. + */ + public ConstantProduct() { + constProperty = "constant"; + constProperty2 = "constant2"; + } + + /** + * Get the constProperty value. + * + * @return the constProperty value + */ + public String constProperty() { + return this.constProperty; + } + + /** + * Set the constProperty value. + * + * @param constProperty the constProperty value to set + * @return the ConstantProduct object itself. + */ + public ConstantProduct withConstProperty(String constProperty) { + this.constProperty = constProperty; + return this; + } + + /** + * Get the constProperty2 value. + * + * @return the constProperty2 value + */ + public String constProperty2() { + return this.constProperty2; + } + + /** + * Set the constProperty2 value. + * + * @param constProperty2 the constProperty2 value to set + * @return the ConstantProduct object itself. + */ + public ConstantProduct withConstProperty2(String constProperty2) { + this.constProperty2 = constProperty2; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/validation/models/EnumConst.java b/test/vanilla/src/main/java/fixtures/validation/models/EnumConst.java new file mode 100644 index 0000000000..659dbfc662 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/models/EnumConst.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.validation.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for EnumConst. + */ +public enum EnumConst { + /** Enum value constant_string_as_enum. */ + CONSTANT_STRING_AS_ENUM("constant_string_as_enum"); + + /** The actual serialized value for a EnumConst instance. */ + private String value; + + EnumConst(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EnumConst instance. + * + * @param value the serialized value to parse. + * @return the parsed EnumConst object, or null if unable to parse. + */ + @JsonCreator + public static EnumConst fromString(String value) { + EnumConst[] items = EnumConst.values(); + for (EnumConst item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/test/vanilla/src/main/java/fixtures/validation/models/Error.java b/test/vanilla/src/main/java/fixtures/validation/models/Error.java new file mode 100644 index 0000000000..743c15763d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/models/Error.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.validation.models; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The code property. + */ + @JsonProperty(value = "code") + private Integer code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The fields property. + */ + @JsonProperty(value = "fields") + private String fields; + + /** + * Get the code value. + * + * @return the code value + */ + public Integer code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(Integer code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the fields value. + * + * @return the fields value + */ + public String fields() { + return this.fields; + } + + /** + * Set the fields value. + * + * @param fields the fields value to set + * @return the Error object itself. + */ + public Error withFields(String fields) { + this.fields = fields; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/validation/models/ErrorException.java b/test/vanilla/src/main/java/fixtures/validation/models/ErrorException.java new file mode 100644 index 0000000000..2cddb3a8e5 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/models/ErrorException.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.validation.models; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/test/vanilla/src/main/java/fixtures/validation/models/Product.java b/test/vanilla/src/main/java/fixtures/validation/models/Product.java new file mode 100644 index 0000000000..5de9f1a866 --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/models/Product.java @@ -0,0 +1,238 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +package fixtures.validation.models; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The product documentation. + */ +public class Product { + /** + * Non required array of unique items from 0 to 6 elements. + */ + @JsonProperty(value = "display_names") + private List displayNames; + + /** + * Non required int betwen 0 and 100 exclusive. + */ + @JsonProperty(value = "capacity") + private Integer capacity; + + /** + * Image URL representing the product. + */ + @JsonProperty(value = "image") + private String image; + + /** + * The child property. + */ + @JsonProperty(value = "child", required = true) + private ChildProduct child; + + /** + * The constChild property. + */ + @JsonProperty(value = "constChild", required = true) + private ConstantProduct constChild; + + /** + * Constant int. + */ + @JsonProperty(value = "constInt", required = true) + private int constInt; + + /** + * Constant string. + */ + @JsonProperty(value = "constString", required = true) + private String constString; + + /** + * Constant string as Enum. Possible values include: + * 'constant_string_as_enum'. + */ + @JsonProperty(value = "constStringAsEnum") + private EnumConst constStringAsEnum; + + /** + * Creates an instance of Product class. + */ + public Product() { + constChild = new ConstantProduct(); + constInt = 0; + constString = "constant"; + } + + /** + * Get the displayNames value. + * + * @return the displayNames value + */ + public List displayNames() { + return this.displayNames; + } + + /** + * Set the displayNames value. + * + * @param displayNames the displayNames value to set + * @return the Product object itself. + */ + public Product withDisplayNames(List displayNames) { + this.displayNames = displayNames; + return this; + } + + /** + * Get the capacity value. + * + * @return the capacity value + */ + public Integer capacity() { + return this.capacity; + } + + /** + * Set the capacity value. + * + * @param capacity the capacity value to set + * @return the Product object itself. + */ + public Product withCapacity(Integer capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the image value. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the image value. + * + * @param image the image value to set + * @return the Product object itself. + */ + public Product withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the child value. + * + * @return the child value + */ + public ChildProduct child() { + return this.child; + } + + /** + * Set the child value. + * + * @param child the child value to set + * @return the Product object itself. + */ + public Product withChild(ChildProduct child) { + this.child = child; + return this; + } + + /** + * Get the constChild value. + * + * @return the constChild value + */ + public ConstantProduct constChild() { + return this.constChild; + } + + /** + * Set the constChild value. + * + * @param constChild the constChild value to set + * @return the Product object itself. + */ + public Product withConstChild(ConstantProduct constChild) { + this.constChild = constChild; + return this; + } + + /** + * Get the constInt value. + * + * @return the constInt value + */ + public int constInt() { + return this.constInt; + } + + /** + * Set the constInt value. + * + * @param constInt the constInt value to set + * @return the Product object itself. + */ + public Product withConstInt(int constInt) { + this.constInt = constInt; + return this; + } + + /** + * Get the constString value. + * + * @return the constString value + */ + public String constString() { + return this.constString; + } + + /** + * Set the constString value. + * + * @param constString the constString value to set + * @return the Product object itself. + */ + public Product withConstString(String constString) { + this.constString = constString; + return this; + } + + /** + * Get the constStringAsEnum value. + * + * @return the constStringAsEnum value + */ + public EnumConst constStringAsEnum() { + return this.constStringAsEnum; + } + + /** + * Set the constStringAsEnum value. + * + * @param constStringAsEnum the constStringAsEnum value to set + * @return the Product object itself. + */ + public Product withConstStringAsEnum(EnumConst constStringAsEnum) { + this.constStringAsEnum = constStringAsEnum; + return this; + } + +} diff --git a/test/vanilla/src/main/java/fixtures/validation/models/package-info.java b/test/vanilla/src/main/java/fixtures/validation/models/package-info.java new file mode 100644 index 0000000000..6059286c5b --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/models/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the models classes for AutoRestValidationTest. + * Test Infrastructure for AutoRest. No server backend exists for these tests. + */ +package fixtures.validation.models; diff --git a/test/vanilla/src/main/java/fixtures/validation/package-info.java b/test/vanilla/src/main/java/fixtures/validation/package-info.java new file mode 100644 index 0000000000..111f438a6d --- /dev/null +++ b/test/vanilla/src/main/java/fixtures/validation/package-info.java @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +/** + * This package contains the classes for AutoRestValidationTest. + * Test Infrastructure for AutoRest. No server backend exists for these tests. + */ +package fixtures.validation; diff --git a/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java b/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java new file mode 100644 index 0000000000..b5215fa450 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodyarray/ArrayTests.java @@ -0,0 +1,591 @@ +package fixtures.bodyarray; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import fixtures.bodyarray.implementation.AutoRestSwaggerBATArrayServiceImpl; +import fixtures.bodyarray.models.ErrorException; +import fixtures.bodyarray.models.Product; + +public class ArrayTests { + private static AutoRestSwaggerBATArrayService client; + + @BeforeClass + public static void setup() throws Exception { + client = new AutoRestSwaggerBATArrayServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + Assert.assertNull(client.arrays().getNull()); + } + + @Test + public void getInvalid() throws Exception { + try { + List result = client.arrays().getInvalid(); + Assert.assertTrue(false); + } catch (RuntimeException exception) { + // expected + Assert.assertTrue(exception.getMessage().contains("Unexpected end-of-input")); + } + } + + @Test + public void getEmpty() throws Exception { + List result = client.arrays().getEmpty(); + Assert.assertEquals(0, result.size()); + } + + @Test + public void putEmpty() throws Exception { + client.arrays().putEmpty(new ArrayList()); + } + + @Test + public void getBooleanTfft() throws Exception { + List result = client.arrays().getBooleanTfft(); + Object[] exected = new Boolean[] {true, false, false, true}; + Assert.assertArrayEquals(exected, result.toArray()); + } + + @Test + public void putBooleanTfft() throws Exception { + client.arrays().putBooleanTfft(Arrays.asList(true, false, false, true)); + } + + @Test + public void getBooleanInvalidNull() throws Exception { + try { + List result = client.arrays().getBooleanInvalidNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getBooleanInvalidString() throws Exception { + try { + List result = client.arrays().getBooleanInvalidString(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("only \"true\" or \"false\" recognized")); + } + } + + @Test + public void getIntegerValid() throws Exception { + List result = client.arrays().getIntegerValid(); + Object[] expected = new Integer[] {1, -1, 3, 300}; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putIntegerValid() throws Exception { + client.arrays().putIntegerValid(Arrays.asList(1, -1, 3, 300)); + } + + @Test + public void getIntInvalidNull() throws Exception { + try { + List result = client.arrays().getIntInvalidNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getIntInvalidString() throws Exception { + try { + List result = client.arrays().getIntInvalidString(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("not a valid Integer value")); + } + } + + @Test + public void getLongValid() throws Exception { + List result = client.arrays().getLongValid(); + Object[] expected = new Long[] {1L, -1L, 3L, 300L}; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putLongValid() throws Exception { + client.arrays().putLongValid(Arrays.asList(1L, -1L, 3L, 300L)); + } + + @Test + public void getLongInvalidNull() throws Exception { + try { + List result = client.arrays().getLongInvalidNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getLongInvalidString() throws Exception { + try { + List result = client.arrays().getLongInvalidString(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("not a valid Long value")); + } + } + + @Test + public void getFloatValid() throws Exception { + List result = client.arrays().getFloatValid(); + Object[] expected = new Double[] {0d, -0.01, -1.2e20}; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putFloatValid() throws Exception { + client.arrays().putFloatValid(Arrays.asList(0d, -0.01d, -1.2e20d)); + } + + @Test + public void getFloatInvalidNull() throws Exception { + try { + List result = client.arrays().getFloatInvalidNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getFloatInvalidString() throws Exception { + try { + List result = client.arrays().getFloatInvalidString(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("not a valid Double value")); + } + } + + @Test + public void getDoubleValid() throws Exception { + List result = client.arrays().getDoubleValid(); + Object[] expected = new Double[] {0d, -0.01, -1.2e20}; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putDoubleValid() throws Exception { + client.arrays().putDoubleValid(Arrays.asList(0d, -0.01d, -1.2e20d)); + } + + @Test + public void getDoubleInvalidNull() throws Exception { + try { + List result = client.arrays().getDoubleInvalidNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getDoubleInvalidString() throws Exception { + try { + List result = client.arrays().getDoubleInvalidString(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("not a valid Double value")); + } + } + + @Test + public void getStringValid() throws Exception { + List result = client.arrays().getStringValid(); + Object[] expected = new String[] {"foo1", "foo2", "foo3"}; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putStringValid() throws Exception { + client.arrays().putStringValid(Arrays.asList("foo1", "foo2", "foo3")); + } + + @Test + public void getStringWithNull() throws Exception { + try { + List result = client.arrays().getStringWithNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getStringWithInvalid() throws Exception { + try { + List result = client.arrays().getStringWithInvalid(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("InvalidFormatException")); + } + } + + @Test + public void getUuidValid() throws Exception { + List result = client.arrays().getUuidValid(); + Object[] expected = new UUID[] {UUID.fromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652"), + UUID.fromString("d1399005-30f7-40d6-8da6-dd7c89ad34db"), + UUID.fromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205")}; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putUuidValid() throws Exception { + client.arrays().putUuidValid(Arrays.asList(UUID.fromString("6dcc7237-45fe-45c4-8a6b-3a8a3f625652"), + UUID.fromString("d1399005-30f7-40d6-8da6-dd7c89ad34db"), UUID.fromString("f42f6aa1-a5bc-4ddf-907e-5f915de43205"))); + } + + @Test + public void getUuidInvalidChars() throws Exception { + try { + List result = client.arrays().getUuidInvalidChars(); + Assert.fail(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage(), ex.getMessage().contains("UUID has to be represented")); + } + } + @Test + public void getDateValid() throws Exception { + List result = client.arrays().getDateValid(); + Object[] expected = new LocalDate[] { + new LocalDate(2000, 12, 1), + new LocalDate(1980, 1, 2), + new LocalDate(1492, 10, 12) + }; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putDateValid() throws Exception { + client.arrays().putDateValid(Arrays.asList( + new LocalDate(2000, 12, 1), + new LocalDate(1980, 1, 2), + new LocalDate(1492, 10, 12) + )); + } + + @Test + public void getDateInvalidNull() throws Exception { + try { + List result = client.arrays().getDateInvalidNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getDateInvalidString() throws Exception { + try { + List result = client.arrays().getDateInvalidChars(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date\"")); + } + } + + @Test + public void getDateTimeValid() throws Exception { + List result = client.arrays().getDateTimeValid(); + Object[] expected = new DateTime[] { + new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC), + new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC), + new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC) + }; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putDateTimeValid() throws Exception { + client.arrays().putDateTimeValid(Arrays.asList( + new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC), + new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC), + new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC) + )); + } + + @Test + public void getDateTimeInvalidNull() throws Exception { + try { + List result = client.arrays().getDateTimeInvalidNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getDateTimeInvalidString() throws Exception { + try { + List result = client.arrays().getDateTimeInvalidChars(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date-time\"")); + } + } + + @Test + public void getDateTimeRfc1123Valid() throws Exception { + List result = client.arrays().getDateTimeRfc1123Valid(); + Object[] expected = new DateTime[] { + new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC), + new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC), + new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC) + }; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putDateTimeRfc1123Valid() throws Exception { + client.arrays().putDateTimeRfc1123Valid(Arrays.asList( + new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC), + new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC), + new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC) + )); + } + + @Test + public void getDurationValid() throws Exception { + List result = client.arrays().getDurationValid(); + Object[] expected = new Period[] { + new Period(0, 0, 0, 123, 22, 14, 12, 11), + new Period(0, 0, 0, 5, 1, 0, 0, 0) + }; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putDurationValid() throws Exception { + client.arrays().putDurationValid(Arrays.asList( + new Period(0, 0, 0, 123, 22, 14, 12, 11), + new Period(0, 0, 0, 5, 1, 0, 0, 0))); + } + + @Test + public void getByteValid() throws Exception { + List result = client.arrays().getByteValid(); + Object[] expected = new byte[][] { + new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA}, + new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x03}, + new byte[] {(byte) 0x25, (byte) 0x29, (byte) 0x43} + }; + Assert.assertArrayEquals(expected, result.toArray()); + } + + @Test + public void putByteValid() throws Exception { + client.arrays().putByteValid(Arrays.asList( + new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA}, + new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x03}, + new byte[] {(byte) 0x25, (byte) 0x29, (byte) 0x43} + )); + } + + @Test + public void getByteInvalidNull() throws Exception { + try { + List result = client.arrays().getByteInvalidNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getBase64Url() throws Exception { + List result = client.arrays().getBase64Url(); + Assert.assertEquals(3, result.size()); + Assert.assertEquals("a string that gets encoded with base64url", new String(result.get(0))); + Assert.assertEquals("test string", new String(result.get(1))); + Assert.assertEquals("Lorem ipsum", new String(result.get(2))); + } + + @Test + public void getComplexNull() throws Exception { + try { + List result = client.arrays().getComplexNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getComplexEmpty() throws Exception { + List result = client.arrays().getComplexEmpty(); + Assert.assertEquals(0, result.size()); + } + + @Test + public void getComplexItemNull() throws Exception { + List result = client.arrays().getComplexItemNull(); + Assert.assertEquals(3, result.size()); + Assert.assertNull(result.get(1)); + } + + @Test + public void getComplexItemEmpty() throws Exception { + List result = client.arrays().getComplexItemEmpty(); + Assert.assertEquals(3, result.size()); + Assert.assertNull(result.get(1).stringProperty()); + } + + @Test + public void getComplexValid() throws Exception { + List result = client.arrays().getComplexValid(); + Assert.assertEquals(3, result.size()); + Assert.assertEquals(5, result.get(2).integer().intValue()); + Assert.assertEquals("6", result.get(2).stringProperty()); + } + + @Test + public void putComplexValid() throws Exception { + List body = new ArrayList(); + Product p1 = new Product(); + p1.withInteger(1); + p1.withStringProperty("2"); + body.add(p1); + Product p2 = new Product(); + p2.withInteger(3); + p2.withStringProperty("4"); + body.add(p2); + Product p3 = new Product(); + p3.withInteger(5); + p3.withStringProperty("6"); + body.add(p3); + client.arrays().putComplexValid(body); + } + + @Test + public void getArrayNull() throws Exception { + try { + List> result = client.arrays().getArrayNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getArrayEmpty() throws Exception { + List> result = client.arrays().getArrayEmpty(); + Assert.assertEquals(0, result.size()); + } + + @Test + public void getArrayItemNull() throws Exception { + List> result = client.arrays().getArrayItemNull(); + Assert.assertEquals(3, result.size()); + Assert.assertNull(result.get(1)); + } + + @Test + public void getArrayItemEmpty() throws Exception { + List> result = client.arrays().getArrayItemEmpty(); + Assert.assertEquals(3, result.size()); + Assert.assertEquals(0, result.get(1).size()); + } + + @Test + public void getArrayValid() throws Exception { + List> result = client.arrays().getArrayValid(); + Assert.assertArrayEquals(new String[]{"1", "2", "3"}, result.get(0).toArray()); + Assert.assertArrayEquals(new String[]{"4", "5", "6"}, result.get(1).toArray()); + Assert.assertArrayEquals(new String[] {"7", "8", "9"}, result.get(2).toArray()); + } + + @Test + public void putArrayValid() throws Exception { + List> body = new ArrayList>(); + body.add(Arrays.asList("1", "2", "3")); + body.add(Arrays.asList("4", "5", "6")); + body.add(Arrays.asList("7", "8", "9")); + client.arrays().putArrayValid(body); + } + + @Test + public void getDictionaryNull() throws Exception { + try { + List> result = client.arrays().getDictionaryNull(); + } catch (ErrorException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getDictionaryEmpty() throws Exception { + List> result = client.arrays().getDictionaryEmpty(); + Assert.assertEquals(0, result.size()); + } + + @Test + public void getDictionaryItemNull() throws Exception { + List> result = client.arrays().getDictionaryItemNull(); + Assert.assertEquals(3, result.size()); + Assert.assertNull(result.get(1)); + } + + @Test + public void getDictionaryItemEmpty() throws Exception { + List> result = client.arrays().getDictionaryItemEmpty(); + Assert.assertEquals(3, result.size()); + Assert.assertEquals(0, result.get(1).size()); + } + + @Test + public void getDictionaryValid() throws Exception { + List> result = client.arrays().getDictionaryValid(); + Assert.assertEquals("seven", result.get(2).get("7")); + Assert.assertEquals("five", result.get(1).get("5")); + Assert.assertEquals("three", result.get(0).get("3")); + } + + @Test + public void putDictionaryValid() throws Exception { + List> body = new ArrayList>(); + Map m1 = new HashMap(); + m1.put("1", "one"); + m1.put("2", "two"); + m1.put("3", "three"); + body.add(m1); + Map m2 = new HashMap(); + m2.put("4", "four"); + m2.put("5", "five"); + m2.put("6", "six"); + body.add(m2); + Map m3 = new HashMap(); + m3.put("7", "seven"); + m3.put("8", "eight"); + m3.put("9", "nine"); + body.add(m3); + client.arrays().putDictionaryValid(body); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodyboolean/BoolTests.java b/test/vanilla/src/test/java/fixtures/bodyboolean/BoolTests.java new file mode 100644 index 0000000000..f5e33147fc --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodyboolean/BoolTests.java @@ -0,0 +1,63 @@ +package fixtures.bodyboolean; + +import com.fasterxml.jackson.core.JsonParseException; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.bodyboolean.implementation.AutoRestBoolTestServiceImpl; + +import static org.junit.Assert.fail; + +public class BoolTests { + private static AutoRestBoolTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestBoolTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + try { + client.bools().getNull(); + fail(); + } catch (NullPointerException e) { + // expected + } + } + + @Test + public void getInvalid() throws Exception { + try { + client.bools().getInvalid(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } + + @Test + public void getTrue() throws Exception { + boolean result = client.bools().getTrue(); + Assert.assertTrue(result); + } + + @Test + public void getFalse() throws Exception { + boolean result = client.bools().getFalse(); + Assert.assertFalse(result); + } + + @Test + public void putTrue() throws Exception { + client.bools().putTrue(true); + } + + @Test + public void putFalse() throws Exception { + client.bools().putFalse(false); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodybyte/ByteOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodybyte/ByteOperationsTests.java new file mode 100644 index 0000000000..93f70ba08d --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodybyte/ByteOperationsTests.java @@ -0,0 +1,58 @@ +package fixtures.bodybyte; + +import com.fasterxml.jackson.core.JsonParseException; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.bodybyte.implementation.AutoRestSwaggerBATByteServiceImpl; + +public class ByteOperationsTests { + private static AutoRestSwaggerBATByteService client; + + @BeforeClass + public static void setup() { + client = new AutoRestSwaggerBATByteServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + Assert.assertNull(client.bytes().getNull()); + } + + @Test + public void getEmpty() throws Exception { + byte[] result = client.bytes().getEmpty(); + Assert.assertEquals(0, result.length); + } + + @Test + public void getNonAscii() throws Exception { + byte[] result = client.bytes().getNonAscii(); + byte[] expected = new byte[] { + (byte) 0xff, (byte) 0xfe, (byte) 0xfd, (byte) 0xfc, (byte) 0xfb, + (byte) 0xfa, (byte) 0xf9, (byte) 0xf8, (byte) 0xf7, (byte) 0xf6 + }; + Assert.assertArrayEquals(expected, result); + } + + @Test + public void putNonAscii() throws Exception { + byte[] body = new byte[] { + (byte) 0xff, (byte) 0xfe, (byte) 0xfd, (byte) 0xfc, (byte) 0xfb, + (byte) 0xfa, (byte) 0xf9, (byte) 0xf8, (byte) 0xf7, (byte) 0xf6 + }; + client.bytes().putNonAscii(body); + } + + @Test + public void getInvalid() throws Exception { + try { + client.bytes().getInvalid(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/ArrayTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/ArrayTests.java new file mode 100644 index 0000000000..3ff0586766 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/ArrayTests.java @@ -0,0 +1,52 @@ +package fixtures.bodycomplex; + +import fixtures.bodycomplex.implementation.AutoRestComplexTestServiceImpl; +import fixtures.bodycomplex.models.ArrayWrapper; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Arrays; + +public class ArrayTests { + private static AutoRestComplexTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestComplexTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getValid() throws Exception { + ArrayWrapper result = client.arrays().getValid(); + Assert.assertEquals(5, result.array().size()); + Assert.assertEquals("&S#$(*Y", result.array().get(3)); + } + + @Test + public void putValid() throws Exception { + ArrayWrapper body = new ArrayWrapper(); + body.withArray(Arrays.asList("1, 2, 3, 4", "", null, "&S#$(*Y", "The quick brown fox jumps over the lazy dog")); + client.arrays().putValid(body); + } + + @Test + public void getEmpty() throws Exception { + ArrayWrapper result = client.arrays().getEmpty(); + Assert.assertEquals(0, result.array().size()); + } + + @Test + public void putEmpty() throws Exception { + ArrayWrapper body = new ArrayWrapper(); + body.withArray(new ArrayList()); + client.arrays().putEmpty(body); + } + + @Test + public void getNotProvided() throws Exception { + ArrayWrapper result = client.arrays().getNotProvided(); + Assert.assertNull(result.array()); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/BasicOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/BasicOperationsTests.java new file mode 100644 index 0000000000..3c31a92829 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/BasicOperationsTests.java @@ -0,0 +1,70 @@ +package fixtures.bodycomplex; + +import com.fasterxml.jackson.databind.exc.InvalidFormatException; + +import com.microsoft.rest.LogLevel; +import fixtures.bodycomplex.implementation.AutoRestComplexTestServiceImpl; +import fixtures.bodycomplex.models.Basic; +import fixtures.bodycomplex.models.CMYKColors; +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; +import retrofit2.Retrofit; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class BasicOperationsTests { + private static AutoRestComplexTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestComplexTestServiceImpl("http://localhost:3000"); + client.withApiVersion("2015-05-01"); + } + + @Test + public void getValid() throws Exception { + Basic result = client.basics().getValid(); + Assert.assertEquals(2, result.id().intValue()); + Assert.assertEquals("abc", result.name()); + Assert.assertEquals(CMYKColors.YELLOW, result.color()); + } + + @Test + public void putValid() throws Exception { + Basic body = new Basic(); + body.withId(2); + body.withName("abc"); + body.withColor(CMYKColors.MAGENTA); + client.basics().putValid(body); + } + + @Test + public void getInvalid() throws Exception { + try { + client.basics().getInvalid(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(InvalidFormatException.class, exception.getCause().getClass()); + } + } + + @Test + public void getEmpty() throws Exception { + Basic result = client.basics().getEmpty(); + Assert.assertNull(result.name()); + } + + @Test + public void getNull() throws Exception { + Basic result = client.basics().getNull(); + Assert.assertNull(result.name()); + } + + @Test + public void getNotProvided() throws Exception { + Assert.assertNull(client.basics().getNotProvided()); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/DictionaryTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/DictionaryTests.java new file mode 100644 index 0000000000..70a4e610ef --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/DictionaryTests.java @@ -0,0 +1,66 @@ +package fixtures.bodycomplex; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.HashMap; +import java.util.Map; + +import fixtures.bodycomplex.implementation.AutoRestComplexTestServiceImpl; +import fixtures.bodycomplex.models.DictionaryWrapper; + +public class DictionaryTests { + private static AutoRestComplexTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestComplexTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getValid() throws Exception { + DictionaryWrapper result = client.dictionarys().getValid(); + Assert.assertEquals(5, result.defaultProgram().size()); + Assert.assertEquals("", result.defaultProgram().get("exe")); + Assert.assertEquals(null, result.defaultProgram().get("")); + } + + @Test + public void putValid() throws Exception { + DictionaryWrapper body = new DictionaryWrapper(); + Map programs = new HashMap(); + programs.put("txt", "notepad"); + programs.put("bmp", "mspaint"); + programs.put("xls", "excel"); + programs.put("exe", ""); + programs.put("", null); + body.withDefaultProgram(programs); + client.dictionarys().putValid(body); + } + + @Test + public void getEmpty() throws Exception { + DictionaryWrapper result = client.dictionarys().getEmpty(); + Assert.assertEquals(0, result.defaultProgram().size()); + } + + @Test + public void putEmpty() throws Exception { + DictionaryWrapper body = new DictionaryWrapper(); + body.withDefaultProgram(new HashMap()); + client.dictionarys().putEmpty(body); + } + + @Test + public void getNull() throws Exception { + DictionaryWrapper result = client.dictionarys().getNull(); + Assert.assertNull(result.defaultProgram()); + } + + @Test + public void getNotProvided() throws Exception { + DictionaryWrapper result = client.dictionarys().getNotProvided(); + Assert.assertNull(result.defaultProgram()); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/InheritanceTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/InheritanceTests.java new file mode 100644 index 0000000000..9948952eda --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/InheritanceTests.java @@ -0,0 +1,50 @@ +package fixtures.bodycomplex; + +import fixtures.bodycomplex.implementation.AutoRestComplexTestServiceImpl; +import fixtures.bodycomplex.models.Dog; +import fixtures.bodycomplex.models.Siamese; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; + +public class InheritanceTests { + private static AutoRestComplexTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestComplexTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getValid() throws Exception { + Siamese result = client.inheritances().getValid(); + Assert.assertEquals("persian", result.breed()); + Assert.assertEquals("green", result.color()); + Assert.assertEquals(2, result.id().intValue()); + Assert.assertEquals("Siameeee", result.name()); + Assert.assertEquals("french fries", result.hates().get(1).food()); + } + + @Test + public void putValid() throws Exception { + Siamese body = new Siamese(); + body.withBreed("persian"); + body.withColor("green"); + body.withId(2); + body.withName("Siameeee"); + body.withHates(new ArrayList()); + Dog dog1 = new Dog(); + dog1.withName("Potato"); + dog1.withId(1); + dog1.withFood("tomato"); + body.hates().add(dog1); + Dog dog2 = new Dog(); + dog2.withFood("french fries"); + dog2.withId(-1); + dog2.withName("Tomato"); + body.hates().add(dog2); + client.inheritances().putValid(body); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismTests.java new file mode 100644 index 0000000000..9c62bbe348 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismTests.java @@ -0,0 +1,112 @@ +package fixtures.bodycomplex; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; + +import fixtures.bodycomplex.implementation.AutoRestComplexTestServiceImpl; +import fixtures.bodycomplex.models.Fish; +import fixtures.bodycomplex.models.Goblinshark; +import fixtures.bodycomplex.models.Salmon; +import fixtures.bodycomplex.models.Sawshark; +import fixtures.bodycomplex.models.Shark; + +public class PolymorphismTests { + private static AutoRestComplexTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestComplexTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getValid() throws Exception { + Fish result = client.polymorphisms().getValid(); + Assert.assertEquals(Salmon.class, result.getClass()); + Salmon salmon = (Salmon) result; + Assert.assertEquals("alaska", salmon.location()); + Assert.assertEquals(1.0, salmon.length(), 0f); + Assert.assertEquals(3, salmon.siblings().size()); + Assert.assertEquals(Shark.class, salmon.siblings().get(0).getClass()); + Shark sib1 = (Shark) (salmon.siblings().get(0)); + Assert.assertEquals(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC), sib1.birthday()); + Assert.assertEquals(Sawshark.class, salmon.siblings().get(1).getClass()); + Sawshark sib2 = (Sawshark) (salmon.siblings().get(1)); + Assert.assertArrayEquals( + new byte[]{(byte) 255, (byte) 255, (byte) 255, (byte) 255, (byte) 254}, + sib2.picture()); + Goblinshark sib3 = (Goblinshark) (salmon.siblings().get(2)); + Assert.assertEquals(1, sib3.age().longValue()); + Assert.assertEquals(5, sib3.jawsize().longValue()); + } + + @Test + public void putValid() throws Exception { + Salmon body = new Salmon(); + body.withLocation("alaska"); + body.withIswild(true); + body.withSpecies("king"); + body.withLength(1.0); + body.withSiblings(new ArrayList()); + + Shark sib1 = new Shark(); + sib1.withAge(6); + sib1.withBirthday(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib1.withLength(20.0); + sib1.withSpecies("predator"); + body.siblings().add(sib1); + + Sawshark sib2 = new Sawshark(); + sib2.withAge(105); + sib2.withBirthday(new DateTime(1900, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib2.withLength(10.0); + sib2.withPicture(new byte[] {(byte) 255, (byte) 255, (byte) 255, (byte) 255, (byte) 254}); + sib2.withSpecies("dangerous"); + body.siblings().add(sib2); + + Goblinshark sib3 = new Goblinshark(); + sib3.withAge(1); + sib3.withBirthday(new DateTime(2015, 8, 8, 0, 0, 0, DateTimeZone.UTC)); + sib3.withLength(30.0); + sib3.withSpecies("scary"); + sib3.withJawsize(5); + body.siblings().add(sib3); + + client.polymorphisms().putValid(body); + } + + @Test + public void putValidMissingRequired() throws Exception { + try { + Salmon body = new Salmon(); + body.withLocation("alaska"); + body.withIswild(true); + body.withSpecies("king"); + body.withLength(1.0); + body.withSiblings(new ArrayList()); + + Shark sib1 = new Shark(); + sib1.withAge(6); + sib1.withBirthday(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib1.withLength(20.0); + sib1.withSpecies("predator"); + body.siblings().add(sib1); + + Sawshark sib2 = new Sawshark(); + sib2.withAge(105); + sib2.withLength(10.0); + sib2.withPicture(new byte[] {(byte) 255, (byte) 255, (byte) 255, (byte) 255, (byte) 254}); + sib2.withSpecies("dangerous"); + body.siblings().add(sib2); + + client.polymorphisms().putValidMissingRequired(body); + } catch (IllegalArgumentException ex) { + //expected + Assert.assertTrue(ex.getMessage().contains("siblings.birthday is required and cannot be null.")); + } + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismrecursiveTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismrecursiveTests.java new file mode 100644 index 0000000000..87451c06f6 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/PolymorphismrecursiveTests.java @@ -0,0 +1,88 @@ +package fixtures.bodycomplex; + +import fixtures.bodycomplex.implementation.AutoRestComplexTestServiceImpl; +import fixtures.bodycomplex.models.Fish; +import fixtures.bodycomplex.models.Salmon; +import fixtures.bodycomplex.models.Sawshark; +import fixtures.bodycomplex.models.Shark; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; + +public class PolymorphismrecursiveTests { + private static AutoRestComplexTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestComplexTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getValid() throws Exception { + Fish result = client.polymorphicrecursives().getValid(); + Salmon salmon = (Salmon) result; + Shark sib1 = (Shark) (salmon.siblings().get(0)); + Salmon sib2 = (Salmon) (sib1.siblings().get(0)); + Shark sib3 = (Shark) (sib2.siblings().get(0)); + Assert.assertEquals( + new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC), + sib3.birthday()); + } + + @Test + public void putValid() throws Exception { + Salmon body = new Salmon(); + body.withLocation("alaska"); + body.withIswild(true); + body.withSpecies("king"); + body.withLength(1.0); + body.withSiblings(new ArrayList()); + + Shark sib1 = new Shark(); + sib1.withAge(6); + sib1.withBirthday(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib1.withLength(20.0); + sib1.withSpecies("predator"); + sib1.withSiblings(new ArrayList()); + body.siblings().add(sib1); + + Sawshark sib2 = new Sawshark(); + sib2.withAge(105); + sib2.withBirthday(new DateTime(1900, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib2.withLength(10.0); + sib2.withPicture(new byte[] {(byte) 255, (byte) 255, (byte) 255, (byte) 255, (byte) 254}); + sib2.withSpecies("dangerous"); + sib2.withSiblings(new ArrayList()); + body.siblings().add(sib2); + + Salmon sib11 = new Salmon(); + sib11.withIswild(true); + sib11.withLocation("atlantic"); + sib11.withSpecies("coho"); + sib11.withLength(2); + sib11.withSiblings(new ArrayList()); + sib1.siblings().add(sib11); + sib1.siblings().add(sib2); + + Shark sib111 = new Shark(); + sib111.withAge(6); + sib111.withBirthday(new DateTime(2012, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib111.withSpecies("predator"); + sib111.withLength(20); + sib11.siblings().add(sib111); + + Sawshark sib112 = new Sawshark(); + sib112.withAge(105); + sib112.withBirthday(new DateTime(1900, 1, 5, 1, 0, 0, DateTimeZone.UTC)); + sib112.withLength(10.0); + sib112.withPicture(new byte[] {(byte) 255, (byte) 255, (byte) 255, (byte) 255, (byte) 254}); + sib112.withSpecies("dangerous"); + sib11.siblings().add(sib112); + + client.polymorphicrecursives().putValid(body); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/PrimitiveTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/PrimitiveTests.java new file mode 100644 index 0000000000..ffb4402741 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/PrimitiveTests.java @@ -0,0 +1,203 @@ +package fixtures.bodycomplex; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.bodycomplex.implementation.AutoRestComplexTestServiceImpl; +import fixtures.bodycomplex.models.BooleanWrapper; +import fixtures.bodycomplex.models.ByteWrapper; +import fixtures.bodycomplex.models.DateWrapper; +import fixtures.bodycomplex.models.DatetimeWrapper; +import fixtures.bodycomplex.models.Datetimerfc1123Wrapper; +import fixtures.bodycomplex.models.DoubleWrapper; +import fixtures.bodycomplex.models.DurationWrapper; +import fixtures.bodycomplex.models.FloatWrapper; +import fixtures.bodycomplex.models.IntWrapper; +import fixtures.bodycomplex.models.LongWrapper; +import fixtures.bodycomplex.models.StringWrapper; + +public class PrimitiveTests { + private static AutoRestComplexTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestComplexTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getInt() throws Exception { + IntWrapper result = client.primitives().getInt(); + Assert.assertEquals(Integer.valueOf(-1), result.field1()); + Assert.assertEquals(Integer.valueOf(2), result.field2()); + } + + @Test + public void putInt() throws Exception { + IntWrapper body = new IntWrapper(); + body.withField1(-1); + body.withField2(2); + client.primitives().putInt(body); + } + + @Test + public void getLong() throws Exception { + LongWrapper result = client.primitives().getLong(); + Assert.assertEquals(Long.valueOf(1099511627775L), result.field1()); + Assert.assertEquals(Long.valueOf(-999511627788L), result.field2()); + } + + @Test + public void putLong() throws Exception { + LongWrapper body = new LongWrapper(); + body.withField1(1099511627775L); + body.withField2(-999511627788L); + client.primitives().putLong(body); + } + + @Test + public void getFloat() throws Exception { + FloatWrapper result = client.primitives().getFloat(); + Assert.assertEquals(1.05, result.field1(), 0f); + Assert.assertEquals(-0.003, result.field2(), 0f); + } + + @Test + public void putFloat() throws Exception { + FloatWrapper body = new FloatWrapper(); + body.withField1(1.05); + body.withField2(-0.003); + client.primitives().putFloat(body); + } + + @Test + public void getDouble() throws Exception { + DoubleWrapper result = client.primitives().getDouble(); + Assert.assertEquals(3e-100, result.field1(), 0f); + Assert.assertEquals(-0.000000000000000000000000000000000000000000000000000000005, + result.field56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose(), + 0f); + } + + @Test + public void putDouble() throws Exception { + DoubleWrapper body = new DoubleWrapper(); + body.withField1(3e-100); + body.withField56ZerosAfterTheDotAndNegativeZeroBeforeDotAndThisIsALongFieldNameOnPurpose(-5e-57); + client.primitives().putDouble(body); + } + + @Test + public void getBool() throws Exception { + BooleanWrapper result = client.primitives().getBool(); + Assert.assertEquals(true, result.fieldTrue()); + Assert.assertEquals(false, result.fieldFalse()); + } + + @Test + public void putBool() throws Exception { + BooleanWrapper body = new BooleanWrapper(); + body.withFieldFalse(false); + body.withFieldTrue(true); + client.primitives().putBool(body); + } + + @Test + public void getString() throws Exception { + StringWrapper result = client.primitives().getString(); + Assert.assertEquals("goodrequest", result.field()); + Assert.assertEquals("", result.empty()); + Assert.assertEquals(null, result.nullProperty()); + } + + @Test + public void putString() throws Exception { + StringWrapper body = new StringWrapper(); + body.withField("goodrequest"); + body.withEmpty(""); + client.primitives().putString(body); + } + + @Test + public void getDate() throws Exception { + DateWrapper result = client.primitives().getDate(); + Assert.assertEquals(new LocalDate(1, 1, 1), result.field()); + Assert.assertEquals(new LocalDate(2016, 2, 29), result.leap()); + } + + @Test + public void putDate() throws Exception { + DateWrapper body = new DateWrapper(); + body.withField(new LocalDate(1, 1, 1)); + body.withLeap(new LocalDate(2016, 2, 29)); + client.primitives().putDate(body); + } + + @Test + public void getDateTime() throws Exception { + DatetimeWrapper result = client.primitives().getDateTime(); + Assert.assertEquals(new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC), result.field()); + Assert.assertEquals(new DateTime(2015, 5, 18, 18, 38, 0, DateTimeZone.UTC), result.now()); + } + + @Test + public void putDateTime() throws Exception { + DatetimeWrapper body = new DatetimeWrapper(); + body.withField(new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC)); + body.withNow(new DateTime(2015, 5, 18, 18, 38, 0, DateTimeZone.UTC)); + client.primitives().putDateTime(body); + } + + @Test + public void getDateTimeRfc1123() throws Exception { + Datetimerfc1123Wrapper result = client.primitives().getDateTimeRfc1123(); + Assert.assertEquals(new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC), result.field()); + Assert.assertEquals(new DateTime(2015, 5, 18, 11, 38, 0, DateTimeZone.UTC), result.now()); + } + + @Test + public void putDateTimeRfc1123() throws Exception { + Datetimerfc1123Wrapper body = new Datetimerfc1123Wrapper(); + body.withField(new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC)); + body.withNow(new DateTime(2015, 5, 18, 11, 38, 0, DateTimeZone.UTC)); + client.primitives().putDateTimeRfc1123(body); + } + + @Test + public void getDuration() throws Exception { + DurationWrapper result = client.primitives().getDuration(); + Assert.assertEquals(new Period(0, 0, 0, 123, 22, 14, 12, 11), result.field()); + } + + @Test + public void putDuration() throws Exception { + DurationWrapper body = new DurationWrapper(); + body.withField(new Period(0, 0, 0, 123, 22, 14, 12, 11)); + client.primitives().putDuration(body); + } + + @Test + public void getByte() throws Exception { + ByteWrapper result = client.primitives().getByte(); + byte[] expected = new byte[] { + (byte) 255, (byte) 254, (byte) 253, (byte) 252, (byte) 0, + (byte) 250, (byte) 249, (byte) 248, (byte) 247, (byte) 246 + }; + Assert.assertArrayEquals(expected, result.field()); + } + + @Test + public void putByte() throws Exception { + ByteWrapper body = new ByteWrapper(); + byte[] byteArray = new byte[] { + (byte) 255, (byte) 254, (byte) 253, (byte) 252, (byte) 0, + (byte) 250, (byte) 249, (byte) 248, (byte) 247, (byte) 246 + }; + body.withField(byteArray); + client.primitives().putByte(body); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodycomplex/ReadonlypropertyTests.java b/test/vanilla/src/test/java/fixtures/bodycomplex/ReadonlypropertyTests.java new file mode 100644 index 0000000000..809eec0cdf --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodycomplex/ReadonlypropertyTests.java @@ -0,0 +1,22 @@ +package fixtures.bodycomplex; + +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.bodycomplex.implementation.AutoRestComplexTestServiceImpl; +import fixtures.bodycomplex.models.ReadonlyObj; + +public class ReadonlypropertyTests { + private static AutoRestComplexTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestComplexTestServiceImpl("http://localhost:3000"); + } + + @Test + public void putReadOnlyPropertyValid() throws Exception { + ReadonlyObj o = client.readonlypropertys().getValid(); + client.readonlypropertys().putValid(o); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodydate/DateOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodydate/DateOperationsTests.java new file mode 100644 index 0000000000..6557090c1c --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodydate/DateOperationsTests.java @@ -0,0 +1,85 @@ +package fixtures.bodydate; + +import org.joda.time.IllegalFieldValueException; +import org.joda.time.LocalDate; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; + +import fixtures.bodydate.implementation.AutoRestDateTestServiceImpl; + +public class DateOperationsTests { + private static AutoRestDateTestService client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestDateTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + Assert.assertNull(client.dates().getNull()); + } + + @Test + public void getInvalidDate() throws Exception { + try { + client.dates().getInvalidDate(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(IllegalArgumentException.class, exception.getClass()); + } + } + + @Test + public void getOverflowDate() throws Exception { + try { + client.dates().getOverflowDate(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(IllegalArgumentException.class, exception.getClass()); + } + } + + @Test + public void getUnderflowDate() throws Exception { + try { + client.dates().getUnderflowDate(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(IllegalFieldValueException.class, exception.getClass()); + } + } + + @Test + public void putMaxDate() throws Exception { + LocalDate body = new LocalDate(9999, 12, 31); + client.dates().putMaxDate(body); + } + + @Test + public void getMaxDate() throws Exception { + LocalDate expected = new LocalDate(9999, 12, 31); + LocalDate result = client.dates().getMaxDate(); + Assert.assertEquals(expected, result); + } + + @Test + public void putMinDate() throws Exception { + LocalDate body = new LocalDate(1, 1, 1); + client.dates().putMinDate(body); + } + + @Test + public void getMinDate() throws Exception { + LocalDate expected = new LocalDate(1, 1, 1); + LocalDate result = client.dates().getMinDate(); + Assert.assertEquals(expected, result); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodydatetime/DatetimeOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodydatetime/DatetimeOperationsTests.java new file mode 100644 index 0000000000..57bd0351e3 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodydatetime/DatetimeOperationsTests.java @@ -0,0 +1,154 @@ +package fixtures.bodydatetime; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.joda.time.IllegalFieldValueException; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.bodydatetime.implementation.AutoRestDateTimeTestServiceImpl; + +public class DatetimeOperationsTests { + private static AutoRestDateTimeTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestDateTimeTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + Assert.assertNull(client.datetimes().getNull()); + } + + @Test + public void getInvalidDate() throws Exception { + try { + client.datetimes().getInvalid(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(IllegalArgumentException.class, exception.getClass()); + } + } + + @Test + public void getOverflowDate() throws Exception { + DateTime result = client.datetimes().getOverflow(); + // 9999-12-31T23:59:59.999-14:000 + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)); + expected = expected.toDateTime(DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void getUnderflowDate() throws Exception { + try { + client.datetimes().getUnderflow(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(IllegalFieldValueException.class, exception.getClass()); + } + } + + @Test + public void putUtcMaxDateTime() throws Exception { + DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC); + client.datetimes().putUtcMaxDateTime(body); + } + + @Test + public void getUtcLowercaseMaxDateTime() throws Exception { + DateTime result = client.datetimes().getUtcLowercaseMaxDateTime(); + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void getUtcUppercaseMaxDateTime() throws Exception { + DateTime result = client.datetimes().getUtcUppercaseMaxDateTime(); + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void putLocalPositiveOffsetMaxDateTime() throws Exception { + DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(14)); + client.datetimes().putLocalPositiveOffsetMaxDateTime(body); + } + + @Test + public void getLocalPositiveOffsetLowercaseMaxDateTime() throws Exception { + DateTime result = client.datetimes().getLocalPositiveOffsetLowercaseMaxDateTime(); + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(14)).toDateTime(DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void getLocalPositiveOffsetUppercaseMaxDateTime() throws Exception { + DateTime result = client.datetimes().getLocalPositiveOffsetUppercaseMaxDateTime(); + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(14)).toDateTime(DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void putLocalNegativeOffsetMaxDateTime() throws Exception { + DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)); + client.datetimes().putLocalNegativeOffsetMaxDateTime(body); + } + + @Test + public void getLocalNegativeOffsetLowercaseMaxDateTime() throws Exception { + DateTime result = client.datetimes().getLocalNegativeOffsetLowercaseMaxDateTime(); + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)).toDateTime(DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void getLocalNegativeOffsetUppercaseMaxDateTime() throws Exception { + DateTime result = client.datetimes().getLocalNegativeOffsetUppercaseMaxDateTime(); + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 999, DateTimeZone.forOffsetHours(-14)).toDateTime(DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void putUtcMinDateTime() throws Exception { + DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); + client.datetimes().putUtcMinDateTime(body); + } + + @Test + public void getUtcMinDateTime() throws Exception { + DateTime result = client.datetimes().getUtcMinDateTime(); + DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void putLocalPositiveOffsetMinDateTime() throws Exception { + DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(14)); + client.datetimes().putLocalPositiveOffsetMinDateTime(body); + } + + @Test + public void getLocalPositiveOffsetMinDateTime() throws Exception { + DateTime result = client.datetimes().getLocalPositiveOffsetMinDateTime(); + DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(14)).toDateTime(DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void putLocalNegativeOffsetMinDateTime() throws Exception { + DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(-14)); + client.datetimes().putLocalNegativeOffsetMinDateTime(body); + } + + @Test + public void getLocalNegativeOffsetMinDateTime() throws Exception { + DateTime result = client.datetimes().getLocalNegativeOffsetMinDateTime(); + DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.forOffsetHours(-14)).toDateTime(DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodydatetimerfc1123/DateTimeRfc1123OperationsTests.java b/test/vanilla/src/test/java/fixtures/bodydatetimerfc1123/DateTimeRfc1123OperationsTests.java new file mode 100644 index 0000000000..9d2b9f7b3c --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodydatetimerfc1123/DateTimeRfc1123OperationsTests.java @@ -0,0 +1,88 @@ +package fixtures.bodydatetimerfc1123; + +import com.fasterxml.jackson.databind.JsonMappingException; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.bodydatetimerfc1123.implementation.AutoRestRFC1123DateTimeTestServiceImpl; + +public class DateTimeRfc1123OperationsTests { + private static AutoRestRFC1123DateTimeTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestRFC1123DateTimeTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + Assert.assertNull(client.datetimerfc1123s().getNull()); + } + + @Test + public void getInvalidDate() throws Exception { + try { + client.datetimerfc1123s().getInvalid(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(JsonMappingException.class, exception.getCause().getClass()); + } + } + + @Test + public void getOverflowDate() throws Exception { + DateTime result = client.datetimerfc1123s().getOverflow(); + DateTime expected = new DateTime(10000, 1, 1, 00, 00, 00, 0, DateTimeZone.UTC); + expected = expected.toDateTime(DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void getUnderflowDate() throws Exception { + try { + client.datetimerfc1123s().getUnderflow(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(JsonMappingException.class, exception.getCause().getClass()); + } + } + + @Test + public void putUtcMaxDateTime() throws Exception { + DateTime body = new DateTime(9999, 12, 31, 23, 59, 59, 0, DateTimeZone.UTC); + client.datetimerfc1123s().putUtcMaxDateTime(body); + } + + @Test + public void getUtcLowercaseMaxDateTime() throws Exception { + DateTime result = client.datetimerfc1123s().getUtcLowercaseMaxDateTime(); + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 0, DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void getUtcUppercaseMaxDateTime() throws Exception { + DateTime result = client.datetimerfc1123s().getUtcUppercaseMaxDateTime(); + DateTime expected = new DateTime(9999, 12, 31, 23, 59, 59, 0, DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } + + @Test + public void putUtcMinDateTime() throws Exception { + DateTime body = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); + client.datetimerfc1123s().putUtcMinDateTime(body); + } + + @Test + public void getUtcMinDateTime() throws Exception { + DateTime result = client.datetimerfc1123s().getUtcMinDateTime(); + DateTime expected = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeZone.UTC); + Assert.assertEquals(expected, result); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java b/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java new file mode 100644 index 0000000000..3a0d0ee46c --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodydictionary/DictionaryTests.java @@ -0,0 +1,600 @@ +package fixtures.bodydictionary; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import fixtures.bodydictionary.implementation.AutoRestSwaggerBATdictionaryServiceImpl; +import fixtures.bodydictionary.models.Widget; + +import static org.junit.Assert.fail; + +public class DictionaryTests { + private static AutoRestSwaggerBATdictionaryService client; + + @BeforeClass + public static void setup() { + client = new AutoRestSwaggerBATdictionaryServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + Assert.assertNull(client.dictionarys().getNull()); + } + + @Test + public void getInvalid() throws Exception { + try { + client.dictionarys().getInvalid(); + fail(); + } catch (RuntimeException exception) { + // expected + Assert.assertTrue(exception.getMessage().contains("Unexpected character (','")); + } + } + + @Test + public void getEmpty() throws Exception { + Map result = client.dictionarys().getEmpty(); + Assert.assertEquals(0, result.keySet().size()); + } + + @Test + public void putEmpty() throws Exception { + client.dictionarys().putEmpty(new HashMap()); + } + + @Test + public void getNullValue() throws Exception { + Map result = client.dictionarys().getNullValue(); + Assert.assertNull(result.get("key1")); + } + + @Test + public void getNullKey() throws Exception { + try { + client.dictionarys().getNullKey(); + fail(); + } catch (RuntimeException exception) { + // expected + Assert.assertTrue(exception.getMessage().contains("Unexpected character ('n'")); + } + } + + @Test + public void getEmptyStringKey() throws Exception { + Map result = client.dictionarys().getEmptyStringKey(); + Assert.assertEquals("val1", result.get("")); + } + + @Test + public void getBooleanTfft() throws Exception { + Map result = client.dictionarys().getBooleanTfft(); + Map expected = new HashMap(); + expected.put("0", true); + expected.put("1", false); + expected.put("2", false); + expected.put("3", true); + Assert.assertEquals(expected, result); + } + + @Test + public void putBooleanTfft() throws Exception { + Map testData = new HashMap(); + testData.put("0", true); + testData.put("1", false); + testData.put("2", false); + testData.put("3", true); + client.dictionarys().putBooleanTfft(testData); + } + + @Test + public void getBooleanInvalidNull() throws Exception { + Map result = client.dictionarys().getBooleanInvalidNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getBooleanInvalidString() throws Exception { + try { + Map result = client.dictionarys().getBooleanInvalidString(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("only \"true\" or \"false\" recognized")); + } + } + + @Test + public void getIntegerValid() throws Exception { + Map result = client.dictionarys().getIntegerValid(); + Map expected = new HashMap(); + expected.put("0", 1); + expected.put("1", -1); + expected.put("2", 3); + expected.put("3", 300); + Assert.assertEquals(expected, result); + } + + @Test + public void putIntegerValid() throws Exception { + Map testdata = new HashMap(); + testdata.put("0", 1); + testdata.put("1", -1); + testdata.put("2", 3); + testdata.put("3", 300); + client.dictionarys().putIntegerValid(testdata); + } + + @Test + public void getIntInvalidNull() throws Exception { + Map result = client.dictionarys().getIntInvalidNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getIntInvalidString() throws Exception { + try { + Map result = client.dictionarys().getIntInvalidString(); + fail(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("not a valid Integer value")); + } + } + + @Test + public void getLongValid() throws Exception { + Map result = client.dictionarys().getLongValid(); + HashMap expected = new HashMap(); + expected.put("0", 1L); + expected.put("1", -1L); + expected.put("2", 3L); + expected.put("3", 300L); + Assert.assertEquals(expected, result); + } + + @Test + public void putLongValid() throws Exception { + HashMap expected = new HashMap(); + expected.put("0", 1L); + expected.put("1", -1L); + expected.put("2", 3L); + expected.put("3", 300L); + client.dictionarys().putLongValid(expected); + } + + @Test + public void getLongInvalidNull() throws Exception { + Map result = client.dictionarys().getLongInvalidNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getLongInvalidString() throws Exception { + try { + Map result = client.dictionarys().getLongInvalidString(); + fail(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("not a valid Long value")); + } + } + + @Test + public void getFloatValid() throws Exception { + Map result = client.dictionarys().getFloatValid(); + Map expected = new HashMap(); + expected.put("0", 0d); + expected.put("1", -0.01d); + expected.put("2", -1.2e20d); + Assert.assertEquals(expected, result); + } + + @Test + public void putFloatValid() throws Exception { + Map testdata = new HashMap(); + testdata.put("0", 0d); + testdata.put("1", -0.01d); + testdata.put("2", -1.2e20d); + client.dictionarys().putFloatValid(testdata); + } + + @Test + public void getFloatInvalidNull() throws Exception { + Map result = client.dictionarys().getFloatInvalidNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getFloatInvalidString() throws Exception { + try { + Map result = client.dictionarys().getFloatInvalidString(); + fail(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("not a valid Double value")); + } + } + + @Test + public void getDoubleValid() throws Exception { + Map result = client.dictionarys().getDoubleValid(); + Map expected = new HashMap(); + expected.put("0", 0d); + expected.put("1", -0.01d); + expected.put("2", -1.2e20d); + Assert.assertEquals(expected, result); + } + + @Test + public void putDoubleValid() throws Exception { + //{"0": 0, "1": -0.01, "2": 1.2e20} + Map testdata = new HashMap(); + testdata.put("0", 0d); + testdata.put("1", -0.01d); + testdata.put("2", -1.2e20d); + client.dictionarys().putDoubleValid(testdata); + } + + @Test + public void getDoubleInvalidNull() throws Exception { + Map result = client.dictionarys().getDoubleInvalidNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getDoubleInvalidString() throws Exception { + try { + Map result = client.dictionarys().getDoubleInvalidString(); + fail(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("not a valid Double value")); + } + } + + @Test + public void getStringValid() throws Exception { + Map result = client.dictionarys().getStringValid(); + Map expected = new HashMap(); + expected.put("0", "foo1"); + expected.put("1", "foo2"); + expected.put("2", "foo3"); + Assert.assertEquals(expected, result); + } + + @Test + public void putStringValid() throws Exception { + Map testdata = new HashMap(); + testdata.put("0", "foo1"); + testdata.put("1", "foo2"); + testdata.put("2", "foo3"); + client.dictionarys().putStringValid(testdata); + } + + @Test + public void getStringWithNull() throws Exception { + Map result = client.dictionarys().getStringWithNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getStringWithInvalid() throws Exception { + Map result = client.dictionarys().getStringWithInvalid(); + Assert.assertEquals("123", result.get("1")); + } + + @Test + public void getDateValid() throws Exception { + Map result = client.dictionarys().getDateValid(); + Map expected = new HashMap(); + expected.put("0", new LocalDate(2000, 12, 1)); + expected.put("1", new LocalDate(1980, 1, 2)); + expected.put("2", new LocalDate(1492, 10, 12)); + Assert.assertEquals(expected, result); + } + + @Test + public void putDateValid() throws Exception { + Map testdata = new HashMap(); + testdata.put("0", new LocalDate(2000, 12, 1)); + testdata.put("1", new LocalDate(1980, 1, 2)); + testdata.put("2", new LocalDate(1492, 10, 12)); + client.dictionarys().putDateValid(testdata); + } + + @Test + public void getDateInvalidNull() throws Exception { + Map result = client.dictionarys().getDateInvalidNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getDateInvalidString() throws Exception { + try { + Map result = client.dictionarys().getDateInvalidChars(); + fail(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date\"")); + } + } + + @Test + public void getDateTimeValid() throws Exception { + Map result = client.dictionarys().getDateTimeValid(); + Map expected = new HashMap(); + expected.put("0", new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC)); + expected.put("1", new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.forOffsetHours(1)) + .withZone(DateTimeZone.UTC)); + expected.put("2", new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.forOffsetHours(-8)) + .withZone(DateTimeZone.UTC)); + Assert.assertEquals(expected, result); + } + + @Test + public void putDateTimeValid() throws Exception { + Map testdata = new HashMap(); + testdata.put("0", new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC)); + testdata.put("1", new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.forOffsetHours(1))); + testdata.put("2", new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.forOffsetHours(-8))); + client.dictionarys().putDateTimeValid(testdata); + } + + @Test + public void getDateTimeInvalidNull() throws Exception { + Map result = client.dictionarys().getDateTimeInvalidNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getDateTimeInvalidString() throws Exception { + try { + Map result = client.dictionarys().getDateTimeInvalidChars(); + fail(); + } catch (RuntimeException ex) { + // expected + Assert.assertTrue(ex.getMessage().contains("Invalid format: \"date-time\"")); + } + } + + @Test + public void getDateTimeRfc1123Valid() throws Exception { + Map result = client.dictionarys().getDateTimeRfc1123Valid(); + Map expected = new HashMap(); + expected.put("0", new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC)); + expected.put("1", new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC)); + expected.put("2", new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC)); + Assert.assertEquals(expected, result); + } + + @Test + public void putDateTimeRfc1123Valid() throws Exception { + Map testdata = new HashMap(); + testdata.put("0", new DateTime(2000, 12, 1, 0, 0, 1, DateTimeZone.UTC)); + testdata.put("1", new DateTime(1980, 1, 2, 0, 11, 35, DateTimeZone.UTC)); + testdata.put("2", new DateTime(1492, 10, 12, 10, 15, 1, DateTimeZone.UTC)); + client.dictionarys().putDateTimeRfc1123Valid(testdata); + } + + @Test + public void getDurationValid() throws Exception { + Map result = client.dictionarys().getDurationValid(); + Map expected = new HashMap(); + expected.put("0", new Period(0, 0, 0, 123, 22, 14, 12, 11)); + expected.put("1", new Period(0, 0, 0, 5, 1, 0, 0, 0)); + Assert.assertEquals(expected, result); + } + + @Test + public void putDurationValid() throws Exception { + Map testdata = new HashMap(); + testdata.put("0", new Period(0, 0, 0, 123, 22, 14, 12, 11)); + testdata.put("1", new Period(0, 0, 0, 5, 1, 0, 0, 0)); + client.dictionarys().putDurationValid(testdata); + } + + @Test + public void getByteValid() throws Exception { + Map result = client.dictionarys().getByteValid(); + Map expected = new HashMap(); + expected.put("0", new byte[] {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA}); + expected.put("1", new byte[] {(byte) 0x01, (byte) 0x02, (byte) 0x03}); + expected.put("2", new byte[] {(byte) 0x25, (byte) 0x29, (byte) 0x43}); + Assert.assertArrayEquals(expected.get("0"), result.get("0")); + Assert.assertArrayEquals(expected.get("1"), result.get("1")); + Assert.assertArrayEquals(expected.get("2"), result.get("2")); + } + + @Test + public void putByteValid() throws Exception { + Map testdata = new HashMap(); + testdata.put("0", new byte[]{(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFA}); + testdata.put("1", new byte[]{(byte) 0x01, (byte) 0x02, (byte) 0x03}); + testdata.put("2", new byte[]{(byte) 0x25, (byte) 0x29, (byte) 0x43}); + client.dictionarys().putByteValid(testdata); + } + + @Test + public void getByteInvalidNull() throws Exception { + Map result = client.dictionarys().getByteInvalidNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getBase64Url() throws Exception { + Map result = client.dictionarys().getBase64Url(); + Assert.assertEquals("a string that gets encoded with base64url", new String(result.get("0"))); + Assert.assertEquals("test string", new String(result.get("1"))); + Assert.assertEquals("Lorem ipsum", new String(result.get("2"))); + } + + @Test + public void getComplexNull() throws Exception { + Map result = client.dictionarys().getComplexNull(); + Assert.assertNull(result); + } + + @Test + public void getComplexEmpty() throws Exception { + Map result = client.dictionarys().getComplexEmpty(); + Assert.assertEquals(0, result.size()); + } + + @Test + public void getComplexItemNull() throws Exception { + Map result = client.dictionarys().getComplexItemNull(); + Assert.assertEquals(3, result.size()); + Assert.assertNull(result.get("1")); + } + + @Test + public void getComplexItemEmpty() throws Exception { + Map result = client.dictionarys().getComplexItemEmpty(); + Assert.assertEquals(3, result.size()); + Assert.assertNull(result.get("1").integer()); + Assert.assertNull(result.get("1").stringProperty()); + } + + @Test + public void getComplexValid() throws Exception { + Map result = client.dictionarys().getComplexValid(); + Assert.assertEquals(3, result.size()); + Assert.assertEquals(1, result.get("0").integer().intValue()); + Assert.assertEquals("4", result.get("1").stringProperty()); + } + + @Test + public void putComplexValid() throws Exception { + Map body = new HashMap(); + Widget w1 = new Widget(); + w1.withInteger(1); + w1.withStringProperty("2"); + body.put("0", w1); + Widget w2 = new Widget(); + w2.withInteger(3); + w2.withStringProperty("4"); + body.put("1", w2); + Widget w3 = new Widget(); + w3.withInteger(5); + w3.withStringProperty("6"); + body.put("2", w3); + client.dictionarys().putComplexValid(body); + } + + @Test + public void getArrayNull() throws Exception { + Map> result = client.dictionarys().getArrayNull(); + Assert.assertNull(result); + } + + @Test + public void getArrayEmpty() throws Exception { + Map> result = client.dictionarys().getArrayEmpty(); + Assert.assertEquals(0, result.size()); + } + + @Test + public void getArrayItemNull() throws Exception { + Map> result = client.dictionarys().getArrayItemNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getArrayItemEmpty() throws Exception { + Map> result = client.dictionarys().getArrayItemEmpty(); + Assert.assertEquals(0, result.get("1").size()); + } + + @Test + public void getArrayValid() throws Exception { + Map> result = client.dictionarys().getArrayValid(); + Assert.assertArrayEquals(new String[] {"1", "2", "3" }, result.get("0").toArray()); + Assert.assertArrayEquals(new String[] {"4", "5", "6" }, result.get("1").toArray()); + Assert.assertArrayEquals(new String[] {"7", "8", "9" }, result.get("2").toArray()); + } + + @Test + public void putArrayValid() throws Exception { + Map> body = new HashMap>(); + body.put("0", Arrays.asList("1", "2", "3")); + body.put("1", Arrays.asList("4", "5", "6")); + body.put("2", Arrays.asList("7", "8", "9")); + client.dictionarys().putArrayValid(body); + } + + @Test + public void getDictionaryNull() throws Exception { + Assert.assertNull(client.dictionarys().getDictionaryNull()); + } + + @Test + public void getDictionaryEmpty() throws Exception { + Map> result = client.dictionarys().getDictionaryEmpty(); + Assert.assertEquals(0, result.size()); + } + + @Test + public void getDictionaryItemNull() throws Exception { + Map> result = client.dictionarys().getDictionaryItemNull(); + Assert.assertNull(result.get("1")); + } + + @Test + public void getDictionaryItemEmpty() throws Exception { + Map> result = client.dictionarys().getDictionaryItemEmpty(); + Assert.assertEquals(0, result.get("1").size()); + } + + @Test + public void getDictionaryValid() throws Exception { + Map> result = client.dictionarys().getDictionaryValid(); + Map map1 = new HashMap(); + map1.put("1", "one"); + map1.put("2", "two"); + map1.put("3", "three"); + Map map2 = new HashMap(); + map2.put("4", "four"); + map2.put("5", "five"); + map2.put("6", "six"); + Map map3 = new HashMap(); + map3.put("7", "seven"); + map3.put("8", "eight"); + map3.put("9", "nine"); + Map> expected = new HashMap>(); + expected.put("0", map1); + expected.put("1", map2); + expected.put("2", map3); + Assert.assertEquals(expected, result); + } + + @Test + public void putDictionaryValid() throws Exception { + Map map1 = new HashMap(); + map1.put("1", "one"); + map1.put("2", "two"); + map1.put("3", "three"); + Map map2 = new HashMap(); + map2.put("4", "four"); + map2.put("5", "five"); + map2.put("6", "six"); + Map map3 = new HashMap(); + map3.put("7", "seven"); + map3.put("8", "eight"); + map3.put("9", "nine"); + Map> body = new HashMap>(); + body.put("0", map1); + body.put("1", map2); + body.put("2", map3); + client.dictionarys().putDictionaryValid(body); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodyduration/DurationOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodyduration/DurationOperationsTests.java new file mode 100644 index 0000000000..5d8dd826d1 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodyduration/DurationOperationsTests.java @@ -0,0 +1,44 @@ +package fixtures.bodyduration; + +import org.joda.time.Period; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.bodyduration.implementation.AutoRestDurationTestServiceImpl; + + +public class DurationOperationsTests { + private static AutoRestDurationTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestDurationTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + Assert.assertNull(client.durations().getNull()); + } + + @Test + public void getInvalid() throws Exception { + try { + client.durations().getInvalid(); + Assert.fail(); //Should not reach here + } + catch (IllegalArgumentException e) { + //Swallow exceptions + } + } + + @Test + public void getPositiveDuration() throws Exception { + client.durations().getPositiveDuration(); + } + + @Test + public void putPositiveDuration() throws Exception { + client.durations().putPositiveDuration(new Period(0, 0, 0, 123, 22, 14, 12, 11)); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodyfile/FilesTests.java b/test/vanilla/src/test/java/fixtures/bodyfile/FilesTests.java new file mode 100644 index 0000000000..35d1bbf071 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodyfile/FilesTests.java @@ -0,0 +1,71 @@ +package fixtures.bodyfile; + +import org.apache.commons.io.IOUtils; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.util.concurrent.TimeUnit; + +import fixtures.bodyfile.implementation.AutoRestSwaggerBATFileServiceImpl; +import okhttp3.OkHttpClient; +import retrofit2.Retrofit; +import rx.exceptions.Exceptions; +import rx.functions.Func1; + +public class FilesTests { + private static AutoRestSwaggerBATFileService client; + + @BeforeClass + public static void setup() { + OkHttpClient.Builder builder = new OkHttpClient.Builder().readTimeout(1, TimeUnit.MINUTES); + client = new AutoRestSwaggerBATFileServiceImpl("http://localhost:3000", builder, new Retrofit.Builder()); + } + + @Test + public void getFile() throws Exception { + ClassLoader classLoader = getClass().getClassLoader(); + try (InputStream file = classLoader.getResourceAsStream("sample.png")) { + byte[] actual = client.files().getFileAsync() + .map(new Func1() { + @Override + public byte[] call(InputStream inputStreamServiceResponse) { + try { + return IOUtils.toByteArray(inputStreamServiceResponse); + } catch (IOException e) { + throw Exceptions.propagate(e); + } + } + }).toBlocking().single(); + byte[] expected = IOUtils.toByteArray(file); + Assert.assertArrayEquals(expected, actual); + } + } + + @Test + public void getLargeFile() throws Exception { + final long streamSize = 3000L * 1024L * 1024L; + long skipped = client.files().getFileLargeAsync() + .map(new Func1() { + @Override + public Long call(InputStream inputStreamServiceResponse) { + try { + return inputStreamServiceResponse.skip(streamSize); + } catch (IOException e) { + throw Exceptions.propagate(e); + } + } + }).toBlocking().single(); + Assert.assertEquals(streamSize, skipped); + } + + @Test + public void getEmptyFile() throws Exception { + try (InputStream result = client.files().getEmptyFile()) { + byte[] actual = IOUtils.toByteArray(result); + Assert.assertEquals(0, actual.length); + } + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodyformdata/FormdataTests.java b/test/vanilla/src/test/java/fixtures/bodyformdata/FormdataTests.java new file mode 100644 index 0000000000..314b7b8cd6 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodyformdata/FormdataTests.java @@ -0,0 +1,58 @@ +package fixtures.bodyformdata; + +import org.apache.commons.io.IOUtils; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.io.IOException; +import java.io.InputStream; + +import fixtures.bodyformdata.implementation.AutoRestSwaggerBATFormDataServiceImpl; +import rx.exceptions.Exceptions; +import rx.functions.Func1; + +public class FormdataTests { + private static AutoRestSwaggerBATFormDataService client; + + @BeforeClass + public static void setup() { + client = new AutoRestSwaggerBATFormDataServiceImpl("http://localhost:3000"); + } + + @Test + public void uploadFile() throws Exception { + ClassLoader classLoader = getClass().getClassLoader(); + InputStream stream = classLoader.getResourceAsStream("upload.txt"); + byte[] bytes = IOUtils.toByteArray(stream); + stream.close(); + InputStream result = client.formdatas().uploadFile(bytes, "sample.png"); + try { + Assert.assertEquals(new String(bytes), IOUtils.toString(result)); + } finally { + result.close(); + } + } + + @Test + public void uploadFileViaBody() throws Exception { + ClassLoader classLoader = getClass().getClassLoader(); + try (InputStream stream = classLoader.getResourceAsStream("upload.txt")) { + byte[] bytes = IOUtils.toByteArray(stream); + stream.close(); + byte[] actual = client.formdatas().uploadFileViaBodyAsync(bytes) + .map(new Func1() { + @Override + public byte[] call(InputStream inputStreamServiceResponse) { + try { + return IOUtils.toByteArray(inputStreamServiceResponse); + } catch (IOException e) { + throw Exceptions.propagate(e); + } + } + }).toBlocking().single(); + Assert.assertEquals(new String(bytes), IOUtils.toString(actual)); + } + + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodyinteger/IntOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodyinteger/IntOperationsTests.java new file mode 100644 index 0000000000..fa57f82e0d --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodyinteger/IntOperationsTests.java @@ -0,0 +1,197 @@ +package fixtures.bodyinteger; + +import com.fasterxml.jackson.core.JsonParseException; +import com.microsoft.rest.ServiceCallback; + +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import fixtures.bodyinteger.implementation.AutoRestIntegerTestServiceImpl; +import rx.Observable; +import rx.Subscriber; + +import static org.junit.Assert.fail; + +public class IntOperationsTests { + private static AutoRestIntegerTestService client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestIntegerTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + try { + client.ints().getNull(); + fail(); + } catch (NullPointerException e) { + // expected + } + } + + @Test + public void getNullAsync() throws Exception { + Observable.from(client.ints().getNullAsync(null)).subscribe(new Subscriber() { + @Override + public void onCompleted() { + System.out.println("completed"); + } + + @Override + public void onError(Throwable e) { + System.out.println("error" + e); + } + + @Override + public void onNext(Integer integerServiceResponse) { + System.out.println(integerServiceResponse); + } + }); + System.out.println("checkpoint"); + } + + @Test + public void getInvalid() throws Exception { + try { + client.ints().getInvalid(); + Assert.assertTrue(false); + } catch (Exception exception) { + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } + + @Test + public void getOverflowInt32() throws Exception { + try { + client.ints().getOverflowInt32(); + Assert.assertTrue(false); + } catch (Exception exception) { + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } + + @Test + public void getUnderflowInt32() throws Exception { + try { + client.ints().getUnderflowInt32(); + Assert.assertTrue(false); + } catch (Exception exception) { + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } + + @Test + public void getOverflowInt64() throws Exception { + try { + long value = client.ints().getOverflowInt64(); + Assert.assertEquals(Long.MAX_VALUE, value); + } catch (Exception exception) { + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } + + @Test + public void getUnderflowInt64() throws Exception { + try { + long value = client.ints().getUnderflowInt64(); + Assert.assertEquals(Long.MIN_VALUE, value); + } catch (Exception exception) { + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } + + @Test + public void putMax32() throws Exception { + client.ints().putMax32Async(Integer.MAX_VALUE, new ServiceCallback() { + @Override + public void failure(Throwable t) { + } + + @Override + public void success(Void response) { + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void putMax64() throws Exception { + client.ints().putMax64Async(Long.MAX_VALUE, new ServiceCallback() { + @Override + public void failure(Throwable t) { + } + + @Override + public void success(Void response) { + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void putMin32() throws Exception { + client.ints().putMin32Async(Integer.MIN_VALUE, new ServiceCallback() { + @Override + public void failure(Throwable t) { + } + + @Override + public void success(Void response) { + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void putMin64() throws Exception { + client.ints().putMin64Async(Long.MIN_VALUE, new ServiceCallback() { + @Override + public void failure(Throwable t) { + } + + @Override + public void success(Void response) { + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void getUnixTime() throws Exception { + DateTime result = client.ints().getUnixTime(); + Assert.assertEquals(new DateTime(2016, 4, 13, 0, 0, 0, DateTimeZone.UTC), result); + } + + @Test + public void putUnixTimeDate() throws Exception { + client.ints().putUnixTimeDate(new DateTime(2016, 4, 13, 0, 0, 0, DateTimeZone.UTC)); + } + + @Test + public void getInvalidUnixTime() throws Exception { + try { + client.ints().getInvalidUnixTime(); + fail(); + } catch (RuntimeException e) { + Assert.assertTrue(e.getMessage().contains("Unexpected character")); + } + } + + @Test + public void getNullUnixTime() throws Exception { + DateTime result = client.ints().getNullUnixTime(); + Assert.assertNull(result); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodynumber/NumberTests.java b/test/vanilla/src/test/java/fixtures/bodynumber/NumberTests.java new file mode 100644 index 0000000000..a0cf88874d --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodynumber/NumberTests.java @@ -0,0 +1,117 @@ +package fixtures.bodynumber; + +import com.fasterxml.jackson.core.JsonParseException; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.bodynumber.implementation.AutoRestNumberTestServiceImpl; + +import static org.junit.Assert.fail; + +public class NumberTests { + private static AutoRestNumberTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestNumberTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + try { + client.numbers().getNull(); + fail(); + } catch (NullPointerException e) { + // expected + } + } + + @Test + public void getInvalidFloat() throws Exception { + try { + client.numbers().getInvalidFloat(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } + + @Test + public void getInvalidDouble() throws Exception { + try { + client.numbers().getInvalidDouble(); + Assert.assertTrue(false); + } catch (Exception exception) { + // expected + Assert.assertEquals(JsonParseException.class, exception.getCause().getClass()); + } + } + + @Test + public void putBigFloat() throws Exception { + client.numbers().putBigFloat(3.402823e+20); + } + + @Test + public void putBigDouble() throws Exception { + client.numbers().putBigDouble(2.5976931e+101); + } + + @Test + public void getBigFloat() throws Exception { + double result = client.numbers().getBigFloat(); + Assert.assertEquals(3.402823e+20, result, 0.0f); + } + + @Test + public void getBigDouble() throws Exception { + double result = client.numbers().getBigDouble(); + Assert.assertEquals(2.5976931e+101, result, 0.0f); + } + + @Test + public void putBigDoublePositiveDecimal() throws Exception { + client.numbers().putBigDoublePositiveDecimal(99999999.99); + } + + @Test + public void getBigDoublePositiveDecimal() throws Exception { + double result = client.numbers().getBigDoublePositiveDecimal(); + Assert.assertEquals(99999999.99, result, 0.0f); + } + + @Test + public void putBigDoubleNegativeDecimal() throws Exception { + client.numbers().putBigDoubleNegativeDecimal(-99999999.99); + } + + @Test + public void getBigDoubleNegativeDecimal() throws Exception { + double result = client.numbers().getBigDoubleNegativeDecimal(); + Assert.assertEquals(-99999999.99, result, 0.0f); + } + + @Test + public void putSmallFloat() throws Exception { + client.numbers().putSmallFloat(3.402823e-20); + } + + @Test + public void getSmallFloat() throws Exception { + double result = client.numbers().getSmallFloat(); + Assert.assertEquals(3.402823e-20, result, 0.0f); + } + + @Test + public void putSmallDouble() throws Exception { + client.numbers().putSmallDouble(2.5976931e-101); + } + + @Test + public void getSmallDouble() throws Exception { + double result = client.numbers().getSmallDouble(); + Assert.assertEquals(2.5976931e-101, result, 0.0f); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodystring/EnumOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodystring/EnumOperationsTests.java new file mode 100644 index 0000000000..fc1f9a159e --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodystring/EnumOperationsTests.java @@ -0,0 +1,30 @@ +package fixtures.bodystring; + +import fixtures.bodystring.implementation.AutoRestSwaggerBATServiceImpl; +import fixtures.bodystring.models.Colors; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; + +public class EnumOperationsTests { + private static AutoRestSwaggerBATService client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestSwaggerBATServiceImpl("http://localhost:3000"); + } + + @Test + public void getNotExpandable() throws Exception { + Colors result = client.enums().getNotExpandable(); + Assert.assertEquals(Colors.RED_COLOR, result); + } + + @Test + public void putNotExpandable() throws Exception { + client.enums().putNotExpandable(Colors.RED_COLOR); + } +} diff --git a/test/vanilla/src/test/java/fixtures/bodystring/StringOperationsTests.java b/test/vanilla/src/test/java/fixtures/bodystring/StringOperationsTests.java new file mode 100644 index 0000000000..49a7edd6f2 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/bodystring/StringOperationsTests.java @@ -0,0 +1,114 @@ +package fixtures.bodystring; + +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceCallback; +import fixtures.bodystring.implementation.AutoRestSwaggerBATServiceImpl; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +public class StringOperationsTests { + private static AutoRestSwaggerBATService client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestSwaggerBATServiceImpl("http://localhost:3000"); + } + + @Test + public void getNull() throws Exception { + Assert.assertNull(client.strings().getNull()); + } + + @Test + public void putNull() throws Exception { + try { + client.strings().putNull(null); + } catch (Exception ex) { + Assert.assertEquals(IllegalArgumentException.class, ex.getClass()); + Assert.assertTrue(ex.getMessage().contains("Body parameter value must not be null")); + } + } + + @Test + public void getEmpty() throws Exception { + String result = client.strings().getEmpty(); + Assert.assertEquals("", result); + } + + @Test + public void putEmpty() throws Exception { + client.strings().putEmptyAsync("", new ServiceCallback() { + @Override + public void failure(Throwable t) { + } + + @Override + public void success(Void response) { + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void getMbcs() throws Exception { + String result = client.strings().getMbcs(); + String expected = "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑ\uE7C7ɡ〇〾⿻⺁\uE843䜣\uE864€"; + Assert.assertEquals(expected, result); + } + + @Test + public void putMbcs() throws Exception { + String content = "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑ\uE7C7ɡ〇〾⿻⺁\uE843䜣\uE864€"; + client.strings().putMbcs(content); + } + + @Test + public void getWhitespace() throws Exception { + String result = client.strings().getWhitespace(); + Assert.assertEquals(" Now is the time for all good men to come to the aid of their country ", result); + } + + @Test + public void putWhitespace() throws Exception { + client.strings().putWhitespace(" Now is the time for all good men to come to the aid of their country "); + } + + @Test + public void getNotProvided() throws Exception { + try { + client.strings().getNotProvided(); + } catch (Exception ex) { + Assert.assertEquals(RestException.class, ex.getClass()); + Assert.assertTrue(ex.getMessage().contains("JsonMappingException")); + } + } + + @Test + public void getBase64Encoded() throws Exception { + byte[] result = client.strings().getBase64Encoded(); + Assert.assertEquals("a string that gets encoded with base64", new String(result)); + } + + @Test + public void getBase64UrlEncoded() throws Exception { + byte[] result = client.strings().getBase64UrlEncoded(); + Assert.assertEquals("a string that gets encoded with base64url", new String(result)); + } + + @Test + public void getNullBase64UrlEncoded() throws Exception { + byte[] result = client.strings().getNullBase64UrlEncoded(); + Assert.assertNull(result); + } + + @Test + public void putBase64UrlEncoded() throws Exception { + client.strings().putBase64UrlEncoded("a string that gets encoded with base64url".getBytes()); + } +} diff --git a/test/vanilla/src/test/java/fixtures/custombaseuri/CustomBaseUriTests.java b/test/vanilla/src/test/java/fixtures/custombaseuri/CustomBaseUriTests.java new file mode 100644 index 0000000000..3608b78691 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/custombaseuri/CustomBaseUriTests.java @@ -0,0 +1,116 @@ +package fixtures.custombaseuri; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.io.IOException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import fixtures.custombaseuri.implementation.AutoRestParameterizedHostTestClientImpl; +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Response; +import retrofit2.Retrofit; + +import static org.junit.Assert.fail; + +public class CustomBaseUriTests { + private static AutoRestParameterizedHostTestClient client; + + @BeforeClass + public static void setup() { + client = new AutoRestParameterizedHostTestClientImpl(); + } + + // Positive test case + @Test + public void getEmptyWithValidCustomUri() throws Exception { + client.withHost("host:3000"); + client.paths().getEmpty("local"); + } + + @Test + public void getEmptyWithInvalidCustomUriAccountName() throws Exception { + try { + client.paths().getEmpty("bad"); + Assert.assertTrue(false); + } + catch (RuntimeException e) { + Assert.assertTrue(true); + } + } + + @Test + public void getEmptyWithInvalidCustomUriHostName() throws Exception { + try { + client.withHost("badhost"); + client.paths().getEmpty("local"); + Assert.assertTrue(false); + } + catch (RuntimeException e) { + Assert.assertTrue(true); + } + finally { + client.withHost("host:3000"); + } + } + + @Test + public void getEmptyWithEmptyCustomUriAccountName() throws Exception { + try { + client.paths().getEmpty(null); + Assert.assertTrue(false); + } + catch (IllegalArgumentException e) { + Assert.assertTrue(true); + } + } + + @Test + public void getEmptyMultipleThreads() throws Exception { + final CountDownLatch latch = new CountDownLatch(2); + OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder() + .addInterceptor(new Interceptor() { + @Override + public Response intercept(Chain chain) throws IOException { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + // do nothing + } + return chain.proceed(chain.request()); + } + }); + final AutoRestParameterizedHostTestClient client1 = new AutoRestParameterizedHostTestClientImpl(clientBuilder, new Retrofit.Builder()); + client1.withHost("host:3000"); + Thread t1 = new Thread(new Runnable() { + @Override + public void run() { + try { + client1.paths().getEmpty("badlocal"); + fail(); + } catch (RuntimeException e) { + latch.countDown(); + } catch (Exception e) { + fail(); + } + } + }); + Thread t2 = new Thread(new Runnable() { + @Override + public void run() { + try { + client1.paths().getEmpty("local"); + latch.countDown(); + } catch (Exception ex) { + fail(); + } + } + }); + t1.start(); + t2.start(); + Assert.assertTrue(latch.await(15, TimeUnit.SECONDS)); + } +} diff --git a/test/vanilla/src/test/java/fixtures/custombaseurimoreoptions/CustomBaseUriMoreOptionsTests.java b/test/vanilla/src/test/java/fixtures/custombaseurimoreoptions/CustomBaseUriMoreOptionsTests.java new file mode 100644 index 0000000000..85f48a57d9 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/custombaseurimoreoptions/CustomBaseUriMoreOptionsTests.java @@ -0,0 +1,28 @@ +package fixtures.custombaseurimoreoptions; + +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.custombaseurimoreoptions.implementation.AutoRestParameterizedCustomHostTestClientImpl; +import okhttp3.OkHttpClient; +import okhttp3.logging.HttpLoggingInterceptor; +import retrofit2.Retrofit; + +public class CustomBaseUriMoreOptionsTests { + private static AutoRestParameterizedCustomHostTestClient client; + + @BeforeClass + public static void setup() { + OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder() + .addInterceptor(new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY)); + client = new AutoRestParameterizedCustomHostTestClientImpl(clientBuilder, new Retrofit.Builder()); + client.withSubscriptionId("test12"); + } + + // Positive test case + @Test + public void getEmpty() throws Exception { + client.withDnsSuffix("host:3000"); + client.paths().getEmpty("http://lo", "cal", "key1", "v1"); + } +} diff --git a/test/vanilla/src/test/java/fixtures/header/HeaderOperationsTests.java b/test/vanilla/src/test/java/fixtures/header/HeaderOperationsTests.java new file mode 100644 index 0000000000..b3c38f2ac9 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/header/HeaderOperationsTests.java @@ -0,0 +1,648 @@ +package fixtures.header; + +import com.microsoft.rest.ServiceResponseWithHeaders; + +import org.apache.commons.codec.binary.Base64; +import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; +import org.joda.time.LocalDate; +import org.joda.time.Period; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import java.nio.charset.Charset; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import fixtures.header.implementation.AutoRestSwaggerBATHeaderServiceImpl; +import fixtures.header.models.GreyscaleColors; +import fixtures.header.models.HeaderResponseBoolHeaders; +import fixtures.header.models.HeaderResponseByteHeaders; +import fixtures.header.models.HeaderResponseDateHeaders; +import fixtures.header.models.HeaderResponseDatetimeHeaders; +import fixtures.header.models.HeaderResponseDatetimeRfc1123Headers; +import fixtures.header.models.HeaderResponseDoubleHeaders; +import fixtures.header.models.HeaderResponseDurationHeaders; +import fixtures.header.models.HeaderResponseEnumHeaders; +import fixtures.header.models.HeaderResponseExistingKeyHeaders; +import fixtures.header.models.HeaderResponseFloatHeaders; +import fixtures.header.models.HeaderResponseIntegerHeaders; +import fixtures.header.models.HeaderResponseLongHeaders; +import fixtures.header.models.HeaderResponseProtectedKeyHeaders; +import fixtures.header.models.HeaderResponseStringHeaders; +import okhttp3.Headers; +import rx.functions.Action1; + +import static org.junit.Assert.fail; + +public class HeaderOperationsTests { + private static AutoRestSwaggerBATHeaderService client; + private CountDownLatch lock; + + @BeforeClass + public static void setup() { + client = new AutoRestSwaggerBATHeaderServiceImpl("http://localhost:3000"); + } + + @Test + public void paramExistingKey() throws Exception { + client.headers().paramExistingKey("overwrite"); + } + + @Test + public void responseExistingKey() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseExistingKeyWithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("User-Agent") != null) { + Assert.assertEquals("overwrite", headers.get("User-Agent")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramProtectedKey() throws Exception { + try { + client.headers().paramProtectedKey("text/html"); + } catch (RuntimeException ex) { + // OkHttp can actually overwrite header "Content-Type" + } + } + + @Test + public void responseProtectedKey() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseProtectedKeyWithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("Content-Type") != null) { + Assert.assertTrue(headers.get("Content-Type").contains("text/html")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramInteger() throws Exception { + client.headers().paramInteger("positive", 1); + client.headers().paramInteger("negative", -2); + } + + @Test + public void responseInteger() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseIntegerWithServiceResponseAsync("positive") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("1", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseIntegerWithServiceResponseAsync("negative") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("-2", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramLong() throws Exception { + client.headers().paramLong("positive", 105); + client.headers().paramLong("negative", -2); + } + + @Test + public void responseLong() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseLongWithServiceResponseAsync("positive") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("105", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseLongWithServiceResponseAsync("negative") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("-2", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramFloat() throws Exception { + client.headers().paramFloat("positive", 0.07); + client.headers().paramFloat("negative", -3.0); + } + + @Test + public void responseFloat() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseFloatWithServiceResponseAsync("positive") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("0.07", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseFloatWithServiceResponseAsync("negative") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("-3", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramDouble() throws Exception { + client.headers().paramDouble("positive", 7e120); + client.headers().paramDouble("negative", -3.0); + } + + @Test + public void responseDouble() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseDoubleWithServiceResponseAsync("positive") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("7e+120", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseDoubleWithServiceResponseAsync("negative") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("-3", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramBool() throws Exception { + client.headers().paramBool("true", true); + client.headers().paramBool("false", false); + } + + @Test + public void responseBool() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseBoolWithServiceResponseAsync("true") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("true", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseBoolWithServiceResponseAsync("false") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("false", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramString() throws Exception { + client.headers().paramString("valid", "The quick brown fox jumps over the lazy dog"); + client.headers().paramString("null", null); + client.headers().paramString("empty", ""); + } + + @Test + public void responseString() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseStringWithServiceResponseAsync("valid") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("The quick brown fox jumps over the lazy dog", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseStringWithServiceResponseAsync("null") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("null", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseStringWithServiceResponseAsync("empty") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramDate() throws Exception { + client.headers().paramDate("valid", new LocalDate(2010, 1, 1)); + client.headers().paramDate("min", new LocalDate(1, 1, 1)); + } + + @Test + public void responseDate() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseDateWithServiceResponseAsync("valid") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("2010-01-01", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseDateWithServiceResponseAsync("min") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("0001-01-01", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramDuration() throws Exception { + client.headers().paramDuration("valid", new Period(0, 0, 0, 123, 22, 14, 12, 11)); + } + + @Test + public void responseDuration() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseDurationWithServiceResponseAsync("valid") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("P123DT22H14M12.011S", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramDatetimeRfc1123() throws Exception { + client.headers().paramDatetimeRfc1123("valid", new DateTime(2010, 1, 1, 12, 34, 56, DateTimeZone.UTC)); + client.headers().paramDatetimeRfc1123("min", new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC)); + } + + @Test + public void responseDatetimeRfc1123() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseDatetimeRfc1123WithServiceResponseAsync("valid") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("Fri, 01 Jan 2010 12:34:56 GMT", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(100000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseDatetimeRfc1123WithServiceResponseAsync("min") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("Mon, 01 Jan 0001 00:00:00 GMT", headers.get("value")); + lock.countDown(); + + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramDatetime() throws Exception { + client.headers().paramDatetime("valid", new DateTime(2010, 1, 1, 12, 34, 56, DateTimeZone.UTC)); + client.headers().paramDatetime("min", new DateTime(1, 1, 1, 0, 0, 0, DateTimeZone.UTC)); + } + + @Test + public void responseDatetime() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseDatetimeWithServiceResponseAsync("valid") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("2010-01-01T12:34:56Z", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseDatetimeWithServiceResponseAsync("min") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("0001-01-01T00:00:00Z", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramByte() throws Exception { + client.headers().paramByte("valid", "啊齄丂狛狜隣郎隣兀﨩".getBytes(Charset.forName("UTF-8"))); + } + + @Test + public void responseByte() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseByteWithServiceResponseAsync("valid") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + byte[] value = Base64.decodeBase64(headers.get("value")); + String actual = new String(value, Charset.forName("UTF-8")); + Assert.assertEquals("啊齄丂狛狜隣郎隣兀﨩", actual); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void paramEnum() throws Exception { + client.headers().paramEnum("valid", GreyscaleColors.GREY); + client.headers().paramEnum("null", null); + } + + @Test + public void responseEnum() throws Exception { + lock = new CountDownLatch(1); + client.headers().responseEnumWithServiceResponseAsync("valid") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("GREY", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + lock = new CountDownLatch(1); + client.headers().responseEnumWithServiceResponseAsync("null") + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Headers headers = response.response().headers(); + if (headers.get("value") != null) { + Assert.assertEquals("", headers.get("value")); + lock.countDown(); + } + } + }, new Action1() { + @Override + public void call(Throwable throwable) { + fail(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + @Ignore("Custom header not supported yet") + public void customRequestId() throws Exception { + client.headers().customRequestId(); + } +} diff --git a/test/vanilla/src/test/java/fixtures/http/HttpClientFailureTests.java b/test/vanilla/src/test/java/fixtures/http/HttpClientFailureTests.java new file mode 100644 index 0000000000..bf47283b48 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/http/HttpClientFailureTests.java @@ -0,0 +1,248 @@ +package fixtures.http; + +import fixtures.http.implementation.AutoRestHttpInfrastructureTestServiceImpl; +import fixtures.http.models.ErrorException; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import static org.junit.Assert.fail; + +public class HttpClientFailureTests { + private static AutoRestHttpInfrastructureTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestHttpInfrastructureTestServiceImpl("http://localhost:3000"); + } + + @Test + public void head400() throws Exception { + try { + client.httpClientFailures().head400(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void get400() throws Exception { + try { + client.httpClientFailures().get400(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void put400() throws Exception { + try { + client.httpClientFailures().put400(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void patch400() throws Exception { + try { + client.httpClientFailures().patch400(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void post400() throws Exception { + try { + client.httpClientFailures().post400(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void delete400() throws Exception { + try { + client.httpClientFailures().delete400(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void head401() throws Exception { + try { + client.httpClientFailures().head401(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(401, ex.response().code()); + } + } + + @Test + public void get402() throws Exception { + try { + client.httpClientFailures().get402(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(402, ex.response().code()); + } + } + + @Test + public void get403() throws Exception { + try { + client.httpClientFailures().get403(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(403, ex.response().code()); + } + } + + @Test + public void put404() throws Exception { + try { + client.httpClientFailures().put404(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(404, ex.response().code()); + } + } + + @Test + public void patch405() throws Exception { + try { + client.httpClientFailures().patch405(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(405, ex.response().code()); + } + } + + @Test + public void post406() throws Exception { + try { + client.httpClientFailures().post406(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(406, ex.response().code()); + } + } + + @Test + public void delete407() throws Exception { + try { + client.httpClientFailures().delete407(true); + fail(); + } catch (RuntimeException ex) { + Assert.assertTrue(ex.getMessage().contains("Received HTTP_PROXY_AUTH (407) code while not using proxy")); + } + } + + @Test + public void put409() throws Exception { + try { + client.httpClientFailures().put409(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(409, ex.response().code()); + } + } + + @Test + public void head410() throws Exception { + try { + client.httpClientFailures().head410(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(410, ex.response().code()); + } + } + + @Test + public void get411() throws Exception { + try { + client.httpClientFailures().get411(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(411, ex.response().code()); + } + } + + @Test + public void get412() throws Exception { + try { + client.httpClientFailures().get412(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(412, ex.response().code()); + } + } + + @Test + public void put413() throws Exception { + try { + client.httpClientFailures().put413(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(413, ex.response().code()); + } + } + + @Test + public void patch414() throws Exception { + try { + client.httpClientFailures().patch414(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(414, ex.response().code()); + } + } + + @Test + public void post415() throws Exception { + try { + client.httpClientFailures().post415(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(415, ex.response().code()); + } + } + + @Test + public void get416() throws Exception { + try { + client.httpClientFailures().get416(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(416, ex.response().code()); + } + } + + @Test + public void delete417() throws Exception { + try { + client.httpClientFailures().delete417(true); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(417, ex.response().code()); + } + } + + @Test + public void head429() throws Exception { + try { + client.httpClientFailures().head429(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(429, ex.response().code()); + } + } +} diff --git a/test/vanilla/src/test/java/fixtures/http/HttpFailureTests.java b/test/vanilla/src/test/java/fixtures/http/HttpFailureTests.java new file mode 100644 index 0000000000..6ab9d11ba7 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/http/HttpFailureTests.java @@ -0,0 +1,40 @@ +package fixtures.http; + +import com.microsoft.rest.RestException; +import fixtures.http.implementation.AutoRestHttpInfrastructureTestServiceImpl; +import fixtures.http.models.ErrorException; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import static org.junit.Assert.fail; + +public class HttpFailureTests { + private static AutoRestHttpInfrastructureTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestHttpInfrastructureTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getEmptyError() throws Exception { + try { + client.httpFailures().getEmptyError(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void getNoModelError() throws Exception { + try { + client.httpFailures().getNoModelError(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(400, ex.response().code()); + //Assert.assertTrue(ex.getResponse().raw().toString().contains("NoErrorModel")); + } + } +} diff --git a/test/vanilla/src/test/java/fixtures/http/HttpRedirectsTests.java b/test/vanilla/src/test/java/fixtures/http/HttpRedirectsTests.java new file mode 100644 index 0000000000..00c3978988 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/http/HttpRedirectsTests.java @@ -0,0 +1,237 @@ +package fixtures.http; + +import com.microsoft.rest.ServiceResponseWithHeaders; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import fixtures.http.implementation.AutoRestHttpInfrastructureTestServiceImpl; +import fixtures.http.models.HttpRedirectsDelete307Headers; +import fixtures.http.models.HttpRedirectsGet300Headers; +import fixtures.http.models.HttpRedirectsGet301Headers; +import fixtures.http.models.HttpRedirectsGet302Headers; +import fixtures.http.models.HttpRedirectsGet307Headers; +import fixtures.http.models.HttpRedirectsHead300Headers; +import fixtures.http.models.HttpRedirectsHead301Headers; +import fixtures.http.models.HttpRedirectsHead302Headers; +import fixtures.http.models.HttpRedirectsHead307Headers; +import fixtures.http.models.HttpRedirectsPatch302Headers; +import fixtures.http.models.HttpRedirectsPatch307Headers; +import fixtures.http.models.HttpRedirectsPost303Headers; +import fixtures.http.models.HttpRedirectsPost307Headers; +import fixtures.http.models.HttpRedirectsPut301Headers; +import fixtures.http.models.HttpRedirectsPut307Headers; +import rx.functions.Action1; + +public class HttpRedirectsTests { + private static AutoRestHttpInfrastructureTestService client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestHttpInfrastructureTestServiceImpl("http://localhost:3000"); + } + + @Test + public void head300() throws Exception { + client.httpRedirects().head300WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(200, response.headResponse().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(100000, TimeUnit.MILLISECONDS)); + } + + @Test + public void get300() throws Exception { + client.httpRedirects().get300WithServiceResponseAsync() + .subscribe(new Action1, HttpRedirectsGet300Headers>>() { + @Override + public void call(ServiceResponseWithHeaders, HttpRedirectsGet300Headers> response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void head301() throws Exception { + client.httpRedirects().head301WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(200, response.headResponse().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void get301() throws Exception { + client.httpRedirects().get301WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + @Ignore("Not supported yet") + public void put301() throws Exception { + client.httpRedirects().put301WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(301, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void head302() throws Exception { + client.httpRedirects().head302WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(200, response.headResponse().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void get302() throws Exception { + client.httpRedirects().get302WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + @Ignore("Not supported yet") + public void patch302() throws Exception { + client.httpRedirects().patch302WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(302, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void post303() throws Exception { + client.httpRedirects().post303WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void head307() throws Exception { + client.httpRedirects().head307WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(200, response.headResponse().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void get307() throws Exception { + client.httpRedirects().get307WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void put307() throws Exception { + client.httpRedirects().put307WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(307, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void patch307() throws Exception { + client.httpRedirects().patch307WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(307, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void post307() throws Exception { + client.httpRedirects().post307WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(307, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void delete307() throws Exception { + client.httpRedirects().delete307WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponseWithHeaders response) { + Assert.assertEquals(307, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } +} diff --git a/test/vanilla/src/test/java/fixtures/http/HttpRetryTests.java b/test/vanilla/src/test/java/fixtures/http/HttpRetryTests.java new file mode 100644 index 0000000000..194787b1a8 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/http/HttpRetryTests.java @@ -0,0 +1,127 @@ +package fixtures.http; + +import com.microsoft.rest.ServiceResponse; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import fixtures.http.implementation.AutoRestHttpInfrastructureTestServiceImpl; +import rx.functions.Action1; + +public class HttpRetryTests { + private static AutoRestHttpInfrastructureTestService client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestHttpInfrastructureTestServiceImpl("http://localhost:3000"); + } + + @Test + public void head408() throws Exception { + client.httpRetrys().head408WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(200, response.headResponse().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void put500() throws Exception { + client.httpRetrys().put500WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void patch500() throws Exception { + client.httpRetrys().patch500WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void get502() throws Exception { + client.httpRetrys().get502WithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(50000, TimeUnit.MILLISECONDS)); + } + + @Test + public void post503() throws Exception { + client.httpRetrys().post503WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void delete503() throws Exception { + client.httpRetrys().delete503WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void put504() throws Exception { + client.httpRetrys().put504WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void patch504() throws Exception { + client.httpRetrys().patch504WithServiceResponseAsync(true) + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(200, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } +} diff --git a/test/vanilla/src/test/java/fixtures/http/HttpServerFailureTests.java b/test/vanilla/src/test/java/fixtures/http/HttpServerFailureTests.java new file mode 100644 index 0000000000..2ed2fb4e0d --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/http/HttpServerFailureTests.java @@ -0,0 +1,52 @@ +package fixtures.http; + +import fixtures.http.implementation.AutoRestHttpInfrastructureTestServiceImpl; +import fixtures.http.models.ErrorException; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +public class HttpServerFailureTests { + private static AutoRestHttpInfrastructureTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestHttpInfrastructureTestServiceImpl("http://localhost:3000"); + } + + @Test + public void head501() throws Exception { + try { + client.httpServerFailures().head501(); + } catch (ErrorException ex) { + Assert.assertEquals(501, ex.response().code()); + } + } + + @Test + public void get501() throws Exception { + try { + client.httpServerFailures().get501(); + } catch (ErrorException ex) { + Assert.assertEquals(501, ex.response().code()); + } + } + + @Test + public void post505() throws Exception { + try { + client.httpServerFailures().post505(true); + } catch (ErrorException ex) { + Assert.assertEquals(505, ex.response().code()); + } + } + + @Test + public void delete505() throws Exception { + try { + client.httpServerFailures().delete505(true); + } catch (ErrorException ex) { + Assert.assertEquals(505, ex.response().code()); + } + } +} diff --git a/test/vanilla/src/test/java/fixtures/http/HttpSuccessTests.java b/test/vanilla/src/test/java/fixtures/http/HttpSuccessTests.java new file mode 100644 index 0000000000..470f6d9040 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/http/HttpSuccessTests.java @@ -0,0 +1,108 @@ +package fixtures.http; + +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.concurrent.CountDownLatch; + +import fixtures.http.implementation.AutoRestHttpInfrastructureTestServiceImpl; + +public class HttpSuccessTests { + private static AutoRestHttpInfrastructureTestService client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestHttpInfrastructureTestServiceImpl("http://localhost:3000"); + } + + @Test + public void head200() throws Exception { + client.httpSuccess().head200(); + } + + @Test + public void get200() throws Exception { + client.httpSuccess().get200(); + } + + @Test + public void put200() throws Exception { + client.httpSuccess().put200(true); + } + + @Test + public void patch200() throws Exception { + client.httpSuccess().patch200(true); + } + + @Test + public void post200() throws Exception { + client.httpSuccess().post200(true); + } + + @Test + public void delete200() throws Exception { + client.httpSuccess().delete200(true); + } + + @Test + public void put201() throws Exception { + client.httpSuccess().put201(true); + } + + @Test + public void post201() throws Exception { + client.httpSuccess().post201(true); + } + + @Test + public void put202() throws Exception { + client.httpSuccess().put202(true); + } + + @Test + public void patch202() throws Exception { + client.httpSuccess().patch202(true); + } + + @Test + public void post202() throws Exception { + client.httpSuccess().post202(true); + } + + @Test + public void delete202() throws Exception { + client.httpSuccess().delete202(true); + } + + @Test + public void head204() throws Exception { + client.httpSuccess().head204(); + } + + @Test + public void put204() throws Exception { + client.httpSuccess().put204(true); + } + + @Test + public void patch204() throws Exception { + client.httpSuccess().patch204(true); + } + + @Test + public void post204() throws Exception { + client.httpSuccess().post204(true); + } + + @Test + public void delete204() throws Exception { + client.httpSuccess().delete204(true); + } + + @Test + public void head404() throws Exception { + client.httpSuccess().head404(); + } +} diff --git a/test/vanilla/src/test/java/fixtures/http/MultipleResponsesTests.java b/test/vanilla/src/test/java/fixtures/http/MultipleResponsesTests.java new file mode 100644 index 0000000000..880b94f8cf --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/http/MultipleResponsesTests.java @@ -0,0 +1,321 @@ +package fixtures.http; + +import com.microsoft.rest.RestException; +import com.microsoft.rest.ServiceResponse; +import fixtures.http.implementation.AutoRestHttpInfrastructureTestServiceImpl; +import fixtures.http.models.A; +import fixtures.http.models.C; +import fixtures.http.models.D; +import fixtures.http.models.Error; +import fixtures.http.models.ErrorException; +import fixtures.http.models.MyException; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; +import rx.functions.Action1; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.fail; + +public class MultipleResponsesTests { + private static AutoRestHttpInfrastructureTestServiceImpl client; + private CountDownLatch lock = new CountDownLatch(1); + + @BeforeClass + public static void setup() { + client = new AutoRestHttpInfrastructureTestServiceImpl("http://localhost:3000"); + } + + @Test + public void get200Model204NoModelDefaultError200Valid() throws Exception { + A result = client.multipleResponses().get200Model204NoModelDefaultError200Valid(); + Assert.assertEquals(A.class, result.getClass()); + Assert.assertEquals("200", result.statusCode()); + } + + @Test + public void get200Model204NoModelDefaultError204Valid() throws Exception { + A result = client.multipleResponses().get200Model204NoModelDefaultError204Valid(); + Assert.assertNull(result); + } + + @Test + public void get200Model204NoModelDefaultError201Invalid() throws Exception { + try { + client.multipleResponses().get200Model204NoModelDefaultError201Invalid(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(201, ex.response().code()); + } + } + + @Test + public void get200Model204NoModelDefaultError202None() throws Exception { + try { + A result = client.multipleResponses().get200Model204NoModelDefaultError202None(); + } catch (ErrorException ex) { + Assert.assertEquals(202, ex.response().code()); + } + } + + @Test + public void get200Model204NoModelDefaultError400Valid() throws Exception { + try { + client.multipleResponses().get200Model204NoModelDefaultError400Valid(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void get200Model201ModelDefaultError200Valid() throws Exception { + A result = client.multipleResponses().get200Model201ModelDefaultError200Valid(); + Assert.assertEquals("200", result.statusCode()); + } + + @Test + public void get200Model201ModelDefaultError201Valid() throws Exception { + A result = client.multipleResponses().get200Model201ModelDefaultError201Valid(); + Assert.assertEquals("201", result.statusCode()); + } + + @Test + public void get200Model201ModelDefaultError400Valid() throws Exception { + try { + client.multipleResponses().get200Model201ModelDefaultError400Valid(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + Assert.assertEquals(400, ex.body().status().intValue()); + Assert.assertEquals("client error", ex.body().message()); + } + } + + @Test + public void get200ModelA201ModelC404ModelDDefaultError200Valid() throws Exception { + Object result = client.multipleResponses().get200ModelA201ModelC404ModelDDefaultError200Valid(); + A actual = (A) result; + Assert.assertEquals("200", actual.statusCode()); + } + + @Test + public void get200ModelA201ModelC404ModelDDefaultError201Valid() throws Exception { + Object result = client.multipleResponses().get200ModelA201ModelC404ModelDDefaultError201Valid(); + C actual = (C) result; + Assert.assertEquals("201", actual.httpCode()); + } + + @Test + public void get200ModelA201ModelC404ModelDDefaultError404Valid() throws Exception { + Object result = client.multipleResponses().get200ModelA201ModelC404ModelDDefaultError404Valid(); + D actual = (D) result; + Assert.assertEquals("404", actual.httpStatusCode()); + } + + @Test + public void get200ModelA201ModelC404ModelDDefaultError400Valid() throws Exception { + try { + client.multipleResponses().get200ModelA201ModelC404ModelDDefaultError400Valid(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + Error model = ex.body(); + Assert.assertEquals(400, model.status().intValue()); + Assert.assertEquals("client error", model.message()); + } + } + + @Test + public void get202None204NoneDefaultError202None() throws Exception { + client.multipleResponses().get202None204NoneDefaultError202NoneWithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(202, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void get202None204NoneDefaultError204None() throws Exception { + client.multipleResponses().get202None204NoneDefaultError204NoneWithServiceResponseAsync() + .subscribe(new Action1>() { + @Override + public void call(ServiceResponse response) { + Assert.assertEquals(204, response.response().code()); + lock.countDown(); + } + }); + Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS)); + } + + @Test + public void get202None204NoneDefaultError400Valid() throws Exception { + try { + client.multipleResponses().get202None204NoneDefaultError400Valid(); + fail(); + } catch (ErrorException ex) { + Assert.assertEquals(400, ex.response().code()); + Error model = ex.body(); + Assert.assertEquals(400, model.status().intValue()); + Assert.assertEquals("client error", model.message()); + } + } + + @Test + public void get202None204NoneDefaultNone202Invalid() throws Exception { + client.multipleResponses().get202None204NoneDefaultNone202Invalid(); + } + + @Test + public void get202None204NoneDefaultNone204None() throws Exception { + client.multipleResponses().get202None204NoneDefaultNone204None(); + } + + @Test + public void get202None204NoneDefaultNone400None() throws Exception { + try { + client.multipleResponses().get202None204NoneDefaultNone400None(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void get202None204NoneDefaultNone400Invalid() throws Exception { + try { + client.multipleResponses().get202None204NoneDefaultNone400Invalid(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void getDefaultModelA200Valid() throws Exception { + A result = client.multipleResponses().getDefaultModelA200Valid(); + Assert.assertEquals("200", result.statusCode()); + } + + @Test + public void getDefaultModelA200None() throws Exception { + A result = client.multipleResponses().getDefaultModelA200None(); + Assert.assertNull(result); + } + + @Test + public void getDefaultModelA400Valid() throws Exception { + try { + client.multipleResponses().getDefaultModelA400Valid(); + fail(); + } catch (MyException ex) { + Assert.assertEquals(400, ex.response().code()); + Assert.assertEquals("400", ex.body().statusCode()); + } + } + + @Test + public void getDefaultModelA400None() throws Exception { + try { + client.multipleResponses().getDefaultModelA400None(); + fail(); + } catch (MyException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void getDefaultNone200Invalid() throws Exception { + client.multipleResponses().getDefaultNone200Invalid(); + } + + @Test + public void getDefaultNone200None() throws Exception { + client.multipleResponses().getDefaultNone200None(); + } + + @Test + public void getDefaultNone400Invalid() throws Exception { + try { + client.multipleResponses().getDefaultNone400Invalid(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void getDefaultNone400None() throws Exception { + try { + client.multipleResponses().getDefaultNone400None(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void get200ModelA200None() throws Exception { + A result = client.multipleResponses().get200ModelA200None(); + Assert.assertNull(result); + } + + @Test + public void get200ModelA200Valid() throws Exception { + A result = client.multipleResponses().get200ModelA200Valid(); + Assert.assertEquals("200", result.statusCode()); + } + + @Test + public void get200ModelA200Invalid() throws Exception { + Assert.assertEquals(null, client.multipleResponses().get200ModelA200Invalid().statusCode()); + } + + @Test + public void get200ModelA400None() throws Exception { + try { + client.multipleResponses().get200ModelA400None(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(400, ex.response().code()); + Assert.assertNull(ex.body()); + } + } + + @Test + public void get200ModelA400Valid() throws Exception { + try { + client.multipleResponses().get200ModelA400Valid(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void get200ModelA400Invalid() throws Exception { + try { + client.multipleResponses().get200ModelA400Invalid(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(400, ex.response().code()); + } + } + + @Test + public void get200ModelA202Valid() throws Exception { + try { + client.multipleResponses().get200ModelA202Valid(); + fail(); + } catch (RestException ex) { + Assert.assertEquals(202, ex.response().code()); + } + } +} + diff --git a/test/vanilla/src/test/java/fixtures/modelflattening/ModelFlatteningTests.java b/test/vanilla/src/test/java/fixtures/modelflattening/ModelFlatteningTests.java new file mode 100644 index 0000000000..e6b213352d --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/modelflattening/ModelFlatteningTests.java @@ -0,0 +1,245 @@ +package fixtures.modelflattening; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import fixtures.modelflattening.implementation.AutoRestResourceFlatteningTestServiceImpl; +import fixtures.modelflattening.models.FlattenParameterGroup; +import fixtures.modelflattening.models.FlattenedProduct; +import fixtures.modelflattening.models.Resource; +import fixtures.modelflattening.models.ResourceCollection; +import fixtures.modelflattening.models.SimpleProduct; + +public class ModelFlatteningTests { + private static AutoRestResourceFlatteningTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestResourceFlatteningTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getArray() throws Exception { + List result = client.getArray(); + Assert.assertEquals(3, result.size()); + // Resource 1 + Assert.assertEquals("1", result.get(0).id()); + Assert.assertEquals("OK", result.get(0).provisioningStateValues()); + Assert.assertEquals("Product1", result.get(0).pname()); + Assert.assertEquals("Flat", result.get(0).flattenedProductType()); + Assert.assertEquals("Building 44", result.get(0).location()); + Assert.assertEquals("Resource1", result.get(0).name()); + Assert.assertEquals("Succeeded", result.get(0).provisioningState()); + Assert.assertEquals("Microsoft.Web/sites", result.get(0).type()); + Assert.assertEquals("value1", result.get(0).tags().get("tag1")); + Assert.assertEquals("value3", result.get(0).tags().get("tag2")); + // Resource 2 + Assert.assertEquals("2", result.get(1).id()); + Assert.assertEquals("Resource2", result.get(1).name()); + Assert.assertEquals("Building 44", result.get(1).location()); + // Resource 3 + Assert.assertEquals("3", result.get(2).id()); + Assert.assertEquals("Resource3", result.get(2).name()); + } + + @Test + public void putArray() throws Exception { + List body = new ArrayList<>(); + FlattenedProduct product = new FlattenedProduct(); + product.withLocation("West US"); + product.withTags(new HashMap()); + product.tags().put("tag1", "value1"); + product.tags().put("tag2", "value3"); + body.add(product); + FlattenedProduct product1 = new FlattenedProduct(); + product1.withLocation("Building 44"); + body.add(product1); + client.putArray(body); + } + + @Test + public void getDictionary() throws Exception { + Map result = client.getDictionary(); + Assert.assertEquals(3, result.size()); + // Resource 1 + Assert.assertEquals("1", result.get("Product1").id()); + Assert.assertEquals("OK", result.get("Product1").provisioningStateValues()); + Assert.assertEquals("Product1", result.get("Product1").pname()); + Assert.assertEquals("Flat", result.get("Product1").flattenedProductType()); + Assert.assertEquals("Building 44", result.get("Product1").location()); + Assert.assertEquals("Resource1", result.get("Product1").name()); + Assert.assertEquals("Succeeded", result.get("Product1").provisioningState()); + Assert.assertEquals("Microsoft.Web/sites", result.get("Product1").type()); + Assert.assertEquals("value1", result.get("Product1").tags().get("tag1")); + Assert.assertEquals("value3", result.get("Product1").tags().get("tag2")); + // Resource 2 + Assert.assertEquals("2", result.get("Product2").id()); + Assert.assertEquals("Resource2", result.get("Product2").name()); + Assert.assertEquals("Building 44", result.get("Product2").location()); + // Resource 3 + Assert.assertEquals("3", result.get("Product3").id()); + Assert.assertEquals("Resource3", result.get("Product3").name()); + } + + @Test + public void putDictionary() throws Exception { + Map body = new HashMap<>(); + FlattenedProduct product = new FlattenedProduct(); + product.withLocation("West US"); + product.withTags(new HashMap()); + product.tags().put("tag1", "value1"); + product.tags().put("tag2", "value3"); + product.withPname("Product1"); + product.withFlattenedProductType("Flat"); + body.put("Resource1", product); + FlattenedProduct product1 = new FlattenedProduct(); + product1.withLocation("Building 44"); + product1.withPname("Product2"); + product1.withFlattenedProductType("Flat"); + body.put("Resource2", product1); + client.putDictionary(body); + } + + @Test + public void getResourceCollection() throws Exception { + ResourceCollection resultResource = client.getResourceCollection(); + //Dictionaryofresources + Assert.assertEquals(3, resultResource.dictionaryofresources().size()); + // Resource 1 + Assert.assertEquals("1", resultResource.dictionaryofresources().get("Product1").id()); + Assert.assertEquals("OK", resultResource.dictionaryofresources().get("Product1").provisioningStateValues()); + Assert.assertEquals("Product1", resultResource.dictionaryofresources().get("Product1").pname()); + Assert.assertEquals("Flat", resultResource.dictionaryofresources().get("Product1").flattenedProductType()); + Assert.assertEquals("Building 44", resultResource.dictionaryofresources().get("Product1").location()); + Assert.assertEquals("Resource1", resultResource.dictionaryofresources().get("Product1").name()); + Assert.assertEquals("Succeeded", resultResource.dictionaryofresources().get("Product1").provisioningState()); + Assert.assertEquals("Microsoft.Web/sites", resultResource.dictionaryofresources().get("Product1").type()); + Assert.assertEquals("value1", resultResource.dictionaryofresources().get("Product1").tags().get("tag1")); + Assert.assertEquals("value3", resultResource.dictionaryofresources().get("Product1").tags().get("tag2")); + // Resource 2 + Assert.assertEquals("2", resultResource.dictionaryofresources().get("Product2").id()); + Assert.assertEquals("Resource2", resultResource.dictionaryofresources().get("Product2").name()); + Assert.assertEquals("Building 44", resultResource.dictionaryofresources().get("Product2").location()); + // Resource 3 + Assert.assertEquals("3", resultResource.dictionaryofresources().get("Product3").id()); + Assert.assertEquals("Resource3", resultResource.dictionaryofresources().get("Product3").name()); + + //Arrayofresources + Assert.assertEquals(3, resultResource.arrayofresources().size()); + // Resource 1 + Assert.assertEquals("4", resultResource.arrayofresources().get(0).id()); + Assert.assertEquals("OK", resultResource.arrayofresources().get(0).provisioningStateValues()); + Assert.assertEquals("Product4", resultResource.arrayofresources().get(0).pname()); + Assert.assertEquals("Flat", resultResource.arrayofresources().get(0).flattenedProductType()); + Assert.assertEquals("Building 44", resultResource.arrayofresources().get(0).location()); + Assert.assertEquals("Resource4", resultResource.arrayofresources().get(0).name()); + Assert.assertEquals("Succeeded", resultResource.arrayofresources().get(0).provisioningState()); + Assert.assertEquals("Microsoft.Web/sites", resultResource.arrayofresources().get(0).type()); + Assert.assertEquals("value1", resultResource.arrayofresources().get(0).tags().get("tag1")); + Assert.assertEquals("value3", resultResource.arrayofresources().get(0).tags().get("tag2")); + // Resource 2 + Assert.assertEquals("5", resultResource.arrayofresources().get(1).id()); + Assert.assertEquals("Resource5", resultResource.arrayofresources().get(1).name()); + Assert.assertEquals("Building 44", resultResource.arrayofresources().get(1).location()); + // Resource 3 + Assert.assertEquals("6", resultResource.arrayofresources().get(2).id()); + Assert.assertEquals("Resource6", resultResource.arrayofresources().get(2).name()); + + //productresource + Assert.assertEquals("7", resultResource.productresource().id()); + Assert.assertEquals("Resource7", resultResource.productresource().name()); + } + + @Test + public void putResourceCollection() throws Exception { + Map resources = new HashMap<>(); + resources.put("Resource1", new FlattenedProduct()); + resources.get("Resource1").withLocation("West US"); + resources.get("Resource1").withPname("Product1"); + resources.get("Resource1").withFlattenedProductType("Flat"); + resources.get("Resource1").withTags(new HashMap()); + resources.get("Resource1").tags().put("tag1", "value1"); + resources.get("Resource1").tags().put("tag2", "value3"); + + resources.put("Resource2", new FlattenedProduct()); + resources.get("Resource2").withLocation("Building 44"); + resources.get("Resource2").withPname("Product2"); + resources.get("Resource2").withFlattenedProductType("Flat"); + + ResourceCollection complexObj = new ResourceCollection(); + complexObj.withDictionaryofresources(resources); + complexObj.withArrayofresources(new ArrayList()); + complexObj.arrayofresources().add(resources.get("Resource1")); + FlattenedProduct p1 = new FlattenedProduct(); + p1.withLocation("East US"); + p1.withPname("Product2"); + p1.withFlattenedProductType("Flat"); + complexObj.arrayofresources().add(p1); + FlattenedProduct pr = new FlattenedProduct(); + pr.withLocation("India"); + pr.withPname("Azure"); + pr.withFlattenedProductType("Flat"); + complexObj.withProductresource(pr); + + client.putResourceCollection(complexObj); + } + + @Test + public void putSimpleProduct() throws Exception { + SimpleProduct simpleProduct = new SimpleProduct(); + simpleProduct.withDescription("product description"); + simpleProduct.withProductId("123"); + simpleProduct.withMaxProductDisplayName("max name"); + simpleProduct.withCapacity("Large"); + simpleProduct.withOdatavalue("http://foo"); + simpleProduct.withGenericValue("https://generic"); + + SimpleProduct product = client.putSimpleProduct(simpleProduct); + assertSimpleProductEquals(simpleProduct, product); + } + + @Test + public void postFlattenedSimpleProduct() throws Exception { + SimpleProduct simpleProduct = new SimpleProduct(); + simpleProduct.withDescription("product description"); + simpleProduct.withProductId("123"); + simpleProduct.withMaxProductDisplayName("max name"); + simpleProduct.withCapacity("Large"); + simpleProduct.withOdatavalue("http://foo"); + client.postFlattenedSimpleProduct("123", "max name", "product description", null, "http://foo"); + } + + @Test + public void putSimpleProductWithGrouping() throws Exception { + SimpleProduct simpleProduct = new SimpleProduct(); + simpleProduct.withDescription("product description"); + simpleProduct.withProductId("123"); + simpleProduct.withMaxProductDisplayName("max name"); + simpleProduct.withCapacity("Large"); + simpleProduct.withOdatavalue("http://foo"); + + FlattenParameterGroup flattenParameterGroup = new FlattenParameterGroup(); + flattenParameterGroup.withDescription("product description"); + flattenParameterGroup.withProductId("123"); + flattenParameterGroup.withMaxProductDisplayName("max name"); + flattenParameterGroup.withOdatavalue("http://foo"); + flattenParameterGroup.withName("groupproduct"); + + SimpleProduct product = client.putSimpleProductWithGrouping(flattenParameterGroup); + assertSimpleProductEquals(simpleProduct, product); + } + + private void assertSimpleProductEquals(SimpleProduct expected, SimpleProduct actual) throws Exception { + Assert.assertEquals(expected.productId(), actual.productId()); + Assert.assertEquals(expected.description(), actual.description()); + Assert.assertEquals(expected.capacity(), actual.capacity()); + Assert.assertEquals(expected.maxProductDisplayName(), actual.maxProductDisplayName()); + Assert.assertEquals(expected.odatavalue(), actual.odatavalue()); + } +} \ No newline at end of file diff --git a/test/vanilla/src/test/java/fixtures/report/CoverageReporter.java b/test/vanilla/src/test/java/fixtures/report/CoverageReporter.java new file mode 100644 index 0000000000..a6bcb18c7e --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/report/CoverageReporter.java @@ -0,0 +1,49 @@ +package fixtures.report; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import fixtures.report.implementation.AutoRestReportServiceImpl; + +public final class CoverageReporter { + private static AutoRestReportService client = new AutoRestReportServiceImpl("http://localhost:3000"); + + private CoverageReporter() { } + + public static void main(String[] args) throws Exception { + Map report = client.getReport(); + + // Body cannot be null + report.put("putStringNull", 1); + report.put("OptionalIntegerParameter", 1); + report.put("OptionalStringParameter", 1); + report.put("OptionalClassParameter", 1); + report.put("OptionalArrayParameter", 1); + + // Put must contain a body + report.put("OptionalImplicitBody", 1); + + // OkHttp can actually overwrite header "Content-Type" + report.put("HeaderParameterProtectedKey", 1); + + // Redirects not suppoted by OkHttp + report.put("HttpRedirect301Put", 1); + report.put("HttpRedirect302Patch", 1); + + int total = report.size(); + int hit = 0; + List missing = new ArrayList<>(); + for (Map.Entry entry : report.entrySet()) { + if (entry.getValue() != 0) { + hit++; + } else { + missing.add(entry.getKey()); + } + } + System.out.println(hit + " out of " + total + " tests hit. Missing tests:"); + for (String scenario : missing) { + System.out.println(scenario); + } + } +} diff --git a/test/vanilla/src/test/java/fixtures/requiredoptional/ExplicitTests.java b/test/vanilla/src/test/java/fixtures/requiredoptional/ExplicitTests.java new file mode 100644 index 0000000000..12af990172 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/requiredoptional/ExplicitTests.java @@ -0,0 +1,212 @@ +package fixtures.requiredoptional; + +import fixtures.requiredoptional.implementation.AutoRestRequiredOptionalTestServiceImpl; +import fixtures.requiredoptional.models.ArrayOptionalWrapper; +import fixtures.requiredoptional.models.ArrayWrapper; +import fixtures.requiredoptional.models.ClassOptionalWrapper; +import fixtures.requiredoptional.models.ClassWrapper; +import fixtures.requiredoptional.models.IntOptionalWrapper; +import fixtures.requiredoptional.models.StringOptionalWrapper; +import fixtures.requiredoptional.models.StringWrapper; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import static org.junit.Assert.fail; + +public class ExplicitTests { + private static AutoRestRequiredOptionalTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestRequiredOptionalTestServiceImpl("http://localhost:3000"); + } + + @Test + public void postRequiredIntegerParameter() throws Exception { + // Compile time error + //client.explicits().postRequiredIntegerParameter(null); + } + + @Test + public void postOptionalIntegerParameter() throws Exception { + try { + client.explicits().postOptionalIntegerParameter(null); + fail(); + } catch (IllegalArgumentException ex) { + // Body parameter cannot be null + } + } + + @Test + public void postRequiredIntegerProperty() throws Exception { + // Compile time error + //IntWrapper body = new IntWrapper(); + //body.withValue(null); + } + + @Test + public void postOptionalIntegerProperty() throws Exception { + IntOptionalWrapper body = new IntOptionalWrapper(); + body.withValue(null); + client.explicits().postOptionalIntegerProperty(body); + } + + @Test + public void postRequiredIntegerHeader() throws Exception { + // Compile time error + //client.explicits().postRequiredIntegerHeader(null); + } + + @Test + public void postOptionalIntegerHeader() throws Exception { + client.explicits().postOptionalIntegerHeader(null); + } + + @Test + public void postRequiredStringParameter() throws Exception { + try { + client.explicits().postRequiredStringParameter(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter bodyParameter is required")); + } + } + + @Test + public void postOptionalStringParameter() throws Exception { + try { + client.explicits().postOptionalIntegerParameter(null); + fail(); + } catch (IllegalArgumentException ex) { + // Body parameter cannot be null + } + } + + @Test + public void postRequiredStringProperty() throws Exception { + try { + StringWrapper body = new StringWrapper(); + body.withValue(null); + client.explicits().postRequiredStringProperty(body); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("value is required")); + } + } + + @Test + public void postOptionalStringProperty() throws Exception { + StringOptionalWrapper body = new StringOptionalWrapper(); + body.withValue(null); + client.explicits().postOptionalStringProperty(body); + } + + @Test + public void postRequiredStringHeader() throws Exception { + try { + client.explicits().postRequiredStringHeader(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter headerParameter is required")); + } + } + + @Test + public void postOptionalStringHeader() throws Exception { + client.explicits().postOptionalStringHeader(null); + } + + @Test + public void postRequiredClassParameter() throws Exception { + try { + client.explicits().postRequiredClassParameter(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter bodyParameter is required")); + } + } + + @Test + public void postOptionalClassParameter() throws Exception { + try { + client.explicits().postOptionalClassParameter(null); + fail(); + } catch (IllegalArgumentException ex) { + // Body parameter cannot be null + } + } + + @Test + public void postRequiredClassProperty() throws Exception { + try { + ClassWrapper body = new ClassWrapper(); + body.withValue(null); + client.explicits().postRequiredClassProperty(body); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("value is required")); + } + } + + @Test + public void postOptionalClassProperty() throws Exception { + ClassOptionalWrapper body = new ClassOptionalWrapper(); + body.withValue(null); + client.explicits().postOptionalClassProperty(body); + } + + @Test + public void postRequiredArrayParameter() throws Exception { + try { + client.explicits().postRequiredArrayParameter(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter bodyParameter is required")); + } + } + + @Test + public void postOptionalArrayParameter() throws Exception { + try { + client.explicits().postOptionalArrayParameter(null); + fail(); + } catch (IllegalArgumentException ex) { + // Body parameter cannot be null + } + } + + @Test + public void postRequiredArrayProperty() throws Exception { + try { + ArrayWrapper body = new ArrayWrapper(); + body.withValue(null); + client.explicits().postRequiredArrayProperty(body); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("value is required")); + } + } + + @Test + public void postOptionalArrayProperty() throws Exception { + ArrayOptionalWrapper body = new ArrayOptionalWrapper(); + body.withValue(null); + client.explicits().postOptionalArrayProperty(body); + } + + @Test + public void postRequiredArrayHeader() throws Exception { + try { + client.explicits().postRequiredArrayHeader(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter headerParameter is required")); + } + } + + @Test + public void postOptionalArrayHeader() throws Exception { + client.explicits().postOptionalArrayHeader(null); + } +} diff --git a/test/vanilla/src/test/java/fixtures/requiredoptional/ImplicitTests.java b/test/vanilla/src/test/java/fixtures/requiredoptional/ImplicitTests.java new file mode 100644 index 0000000000..a169404f35 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/requiredoptional/ImplicitTests.java @@ -0,0 +1,73 @@ +package fixtures.requiredoptional; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.requiredoptional.implementation.AutoRestRequiredOptionalTestServiceImpl; + +import static org.junit.Assert.fail; + +public class ImplicitTests { + private static AutoRestRequiredOptionalTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestRequiredOptionalTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getRequiredPath() throws Exception { + try { + client.implicits().getRequiredPath(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter pathParameter is required")); + } + } + + @Test + public void putOptionalQuery() throws Exception { + client.implicits().putOptionalQuery(null); + } + + @Test + public void putOptionalHeader() throws Exception { + client.implicits().putOptionalHeader(null); + } + + @Test + public void putOptionalBody() throws Exception { + try { + client.implicits().putOptionalBody(null); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Body parameter value must not be null")); + } + } + + @Test + public void getRequiredGlobalPath() throws Exception { + try { + client.implicits().getRequiredGlobalPath(); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("this.client.requiredGlobalPath() is required")); + } + } + + @Test + public void getRequiredGlobalQuery() throws Exception { + try { + client.implicits().getRequiredGlobalQuery(); + fail(); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("this.client.requiredGlobalQuery() is required")); + } + } + + @Test + public void getOptionalGlobalQuery() throws Exception { + client.implicits().getOptionalGlobalQuery(); + } +} diff --git a/test/vanilla/src/test/java/fixtures/url/PathItemsTests.java b/test/vanilla/src/test/java/fixtures/url/PathItemsTests.java new file mode 100644 index 0000000000..dc040079bb --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/url/PathItemsTests.java @@ -0,0 +1,63 @@ +package fixtures.url; + +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.url.implementation.AutoRestUrlTestServiceImpl; + +public class PathItemsTests { + private static AutoRestUrlTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestUrlTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getAllWithValues() throws Exception { + client.withGlobalStringPath("globalStringPath"); + client.withGlobalStringQuery("globalStringQuery"); + client.pathItems().getAllWithValues( + "localStringPath", + "pathItemStringPath", + "localStringQuery", + "pathItemStringQuery" + ); + } + + @Test + public void getGlobalQueryNull() throws Exception { + client.withGlobalStringPath("globalStringPath"); + client.withGlobalStringQuery(null); + client.pathItems().getGlobalQueryNull( + "localStringPath", + "pathItemStringPath", + "localStringQuery", + "pathItemStringQuery" + ); + } + + @Test + public void getGlobalAndLocalQueryNull() throws Exception { + client.withGlobalStringPath("globalStringPath"); + client.withGlobalStringQuery(null); + client.pathItems().getGlobalAndLocalQueryNull( + "localStringPath", + "pathItemStringPath", + null, + "pathItemStringQuery" + ); + } + + @Test + public void getLocalPathItemQueryNull() throws Exception { + client.withGlobalStringPath("globalStringPath"); + client.withGlobalStringQuery("globalStringQuery"); + client.pathItems().getLocalPathItemQueryNull( + "localStringPath", + "pathItemStringPath", + null, + null + ); + } +} diff --git a/test/vanilla/src/test/java/fixtures/url/PathsTests.java b/test/vanilla/src/test/java/fixtures/url/PathsTests.java new file mode 100644 index 0000000000..af1ae3b2e3 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/url/PathsTests.java @@ -0,0 +1,170 @@ +package fixtures.url; + +import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import fixtures.url.implementation.AutoRestUrlTestServiceImpl; +import fixtures.url.models.UriColor; + +public class PathsTests { + private static AutoRestUrlTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestUrlTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getBooleanTrue() throws Exception { + client.paths().getBooleanTrue(); + } + + @Test + public void getBooleanFalse() throws Exception { + client.paths().getBooleanFalse(); + } + + @Test + public void getIntOneMillion() throws Exception { + client.paths().getIntOneMillion(); + } + + @Test + public void getIntNegativeOneMillion() throws Exception { + client.paths().getIntNegativeOneMillion(); + } + + @Test + public void getTenBillion() throws Exception { + client.paths().getTenBillion(); + } + + @Test + public void getNegativeTenBillion() throws Exception { + client.paths().getNegativeTenBillion(); + } + + @Test + public void floatScientificPositive() throws Exception { + client.paths().floatScientificPositive(); + } + + @Test + public void floatScientificNegative() throws Exception { + client.paths().floatScientificNegative(); + } + + @Test + public void doubleDecimalPositive() throws Exception { + client.paths().doubleDecimalPositive(); + } + + @Test + public void doubleDecimalNegative() throws Exception { + client.paths().doubleDecimalNegative(); + } + + @Test + public void stringUrlEncoded() throws Exception { + client.paths().stringUrlEncoded(); + } + + @Test + public void stringEmpty() throws Exception { + client.paths().stringEmpty(); + } + + @Test + public void stringNull() throws Exception { + try { + client.paths().stringNull(null); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter stringPath is required")); + } + } + + @Test + public void enumValid() throws Exception { + client.paths().enumValid(UriColor.GREEN_COLOR); + } + + @Test + public void enumNull() throws Exception { + try { + client.paths().enumNull(null); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter enumPath is required")); + } + } + + @Test + public void byteMultiByte() throws Exception { + client.paths().byteMultiByte("啊齄丂狛狜隣郎隣兀﨩".getBytes("UTF-8")); + } + + @Test + public void byteEmpty() throws Exception { + client.paths().byteEmpty(); + } + + @Test + public void byteNull() throws Exception { + try { + client.paths().byteNull(null); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter bytePath is required")); + } + } + + @Test + public void dateValid() throws Exception { + client.paths().dateValid(); + } + + @Test + public void dateNull() throws Exception { + try { + client.paths().dateNull(null); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter datePath is required")); + } + } + + @Test + public void dateTimeValid() throws Exception { + client.paths().dateTimeValid(); + } + + @Test + public void dateTimeNull() throws Exception { + try { + client.paths().dateTimeNull(null); + } catch (IllegalArgumentException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter dateTimePath is required")); + } + } + + @Test + public void base64Url() throws Exception { + client.paths().base64Url("lorem".getBytes()); + } + + /* + @Test + public void arrayCsvInPath() throws Exception { + List arrayPath = new ArrayList<>(); + arrayPath.add("ArrayPath1"); + arrayPath.add("begin!*'();:@ &=+$,/?#[]end"); + arrayPath.add(null); + arrayPath.add(""); + client.getPathsOperations().arrayCsvInPath(arrayPath); + } + */ + + @Test + public void unixTimeUrl() throws Exception { + client.paths().unixTimeUrl(DateTime.parse("2016-04-13T00:00:00Z")); + } +} diff --git a/test/vanilla/src/test/java/fixtures/url/QueriesTests.java b/test/vanilla/src/test/java/fixtures/url/QueriesTests.java new file mode 100644 index 0000000000..3568063282 --- /dev/null +++ b/test/vanilla/src/test/java/fixtures/url/QueriesTests.java @@ -0,0 +1,226 @@ +package fixtures.url; + +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +import fixtures.url.implementation.AutoRestUrlTestServiceImpl; +import fixtures.url.models.ErrorException; +import fixtures.url.models.UriColor; + +public class QueriesTests { + private static AutoRestUrlTestService client; + + @BeforeClass + public static void setup() { + client = new AutoRestUrlTestServiceImpl("http://localhost:3000"); + } + + @Test + public void getBooleanTrue() throws Exception { + client.queries().getBooleanTrue(); + } + + @Test + public void getBooleanFalse() throws Exception { + client.queries().getBooleanFalse(); + } + + @Test + public void getBooleanNull() throws Exception { + client.queries().getBooleanNull(null); + } + + @Test + public void getIntOneMillion() throws Exception { + client.queries().getIntOneMillion(); + } + + @Test + public void getIntNegativeOneMillion() throws Exception { + client.queries().getIntNegativeOneMillion(); + } + + @Test + public void getIntNull() throws Exception { + client.queries().getIntNull(null); + } + + @Test + public void getTenBillion() throws Exception { + client.queries().getTenBillion(); + } + + @Test + public void getNegativeTenBillion() throws Exception { + client.queries().getNegativeTenBillion(); + } + + @Test + public void getLongNull() throws Exception { + client.queries().getLongNull(null); + } + + @Test + public void floatScientificPositive() throws Exception { + client.queries().floatScientificPositive(); + } + + @Test + public void floatScientificNegative() throws Exception { + client.queries().floatScientificNegative(); + } + + @Test + public void floatNull() throws Exception { + client.queries().floatNull(null); + } + + @Test + public void doubleDecimalPositive() throws Exception { + client.queries().doubleDecimalPositive(); + } + + @Test + public void doubleDecimalNegative() throws Exception { + client.queries().doubleDecimalNegative(); + } + + @Test + public void doubleNull() throws Exception { + client.queries().doubleNull(null); + } + + @Test + public void stringUrlEncoded() throws Exception { + client.queries().stringUrlEncoded(); + } + + @Test + public void stringEmpty() throws Exception { + client.queries().stringEmpty(); + } + + @Test + public void stringNull() throws Exception { + try { + client.queries().stringNull(null); + } catch (ErrorException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter stringPath is required")); + } + } + + @Test + public void enumValid() throws Exception { + client.queries().enumValid(UriColor.GREEN_COLOR); + } + + @Test + public void enumNull() throws Exception { + try { + client.queries().enumNull(null); + } catch (ErrorException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter enumPath is required")); + } + } + + @Test + public void byteMultiByte() throws Exception { + client.queries().byteMultiByte("啊齄丂狛狜隣郎隣兀﨩".getBytes("UTF-8")); + } + + @Test + public void byteEmpty() throws Exception { + client.queries().byteEmpty(); + } + + @Test + public void byteNull() throws Exception { + try { + client.queries().byteNull(null); + } catch (ErrorException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter bytePath is required")); + } + } + + @Test + public void dateValid() throws Exception { + client.queries().dateValid(); + } + + @Test + public void dateNull() throws Exception { + try { + client.queries().dateNull(null); + } catch (ErrorException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter datePath is required")); + } + } + + @Test + public void dateTimeValid() throws Exception { + client.queries().dateTimeValid(); + } + + @Test + public void dateTimeNull() throws Exception { + try { + client.queries().dateTimeNull(null); + } catch (ErrorException ex) { + Assert.assertTrue(ex.getMessage().contains("Parameter dateTimePath is required")); + } + } + + @Test + public void arrayStringCsvValid() throws Exception { + List query = new ArrayList<>(); + query.add("ArrayQuery1"); + query.add("begin!*'();:@ &=+$,/?#[]end"); + query.add(null); + query.add(""); + client.queries().arrayStringCsvValid(query); + } + + @Test + public void arrayStringCsvNull() throws Exception { + client.queries().arrayStringCsvNull(null); + } + + @Test + public void arrayStringCsvEmpty() throws Exception { + client.queries().arrayStringCsvEmpty(new ArrayList()); + } + + @Test + public void arrayStringSsvValid() throws Exception { + List query = new ArrayList<>(); + query.add("ArrayQuery1"); + query.add("begin!*'();:@ &=+$,/?#[]end"); + query.add(null); + query.add(""); + client.queries().arrayStringSsvValid(query); + } + + @Test + public void arrayStringTsvValid() throws Exception { + List query = new ArrayList<>(); + query.add("ArrayQuery1"); + query.add("begin!*'();:@ &=+$,/?#[]end"); + query.add(null); + query.add(""); + client.queries().arrayStringTsvValid(query); + } + + @Test + public void arrayStringPipesValid() throws Exception { + List query = new ArrayList<>(); + query.add("ArrayQuery1"); + query.add("begin!*'();:@ &=+$,/?#[]end"); + query.add(null); + query.add(""); + client.queries().arrayStringPipesValid(query); + } +} diff --git a/test/vanilla/src/test/resources/sample.png b/test/vanilla/src/test/resources/sample.png new file mode 100644 index 0000000000..91ab860ce1 Binary files /dev/null and b/test/vanilla/src/test/resources/sample.png differ diff --git a/test/vanilla/src/test/resources/upload.txt b/test/vanilla/src/test/resources/upload.txt new file mode 100644 index 0000000000..ff3bb63948 --- /dev/null +++ b/test/vanilla/src/test/resources/upload.txt @@ -0,0 +1 @@ +The quick brown fox jumps over the lazy dog \ No newline at end of file